1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski #ifndef _SD_CUSTOMANIMATIONLIST_HXX 25*b1cdbd2cSJim Jagielski #define _SD_CUSTOMANIMATIONLIST_HXX 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski #include <com/sun/star/drawing/XShape.hpp> 28*b1cdbd2cSJim Jagielski #include <svtools/svtreebx.hxx> 29*b1cdbd2cSJim Jagielski #include <CustomAnimationEffect.hxx> 30*b1cdbd2cSJim Jagielski #include "CustomAnimationPreset.hxx" 31*b1cdbd2cSJim Jagielski #ifndef _SD_CUSTOMANIMATION_HRC 32*b1cdbd2cSJim Jagielski #include "CustomAnimation.hrc" 33*b1cdbd2cSJim Jagielski #endif 34*b1cdbd2cSJim Jagielski 35*b1cdbd2cSJim Jagielski namespace sd { 36*b1cdbd2cSJim Jagielski 37*b1cdbd2cSJim Jagielski class CustomAnimationEffect; 38*b1cdbd2cSJim Jagielski typedef boost::shared_ptr< CustomAnimationEffect > CustomAnimationEffectPtr; 39*b1cdbd2cSJim Jagielski 40*b1cdbd2cSJim Jagielski class ICustomAnimationListController 41*b1cdbd2cSJim Jagielski { 42*b1cdbd2cSJim Jagielski public: 43*b1cdbd2cSJim Jagielski virtual void onSelect() = 0; 44*b1cdbd2cSJim Jagielski virtual void onDoubleClick() = 0; 45*b1cdbd2cSJim Jagielski virtual void onContextMenu( sal_uInt16 nSelectedPopupEntry ) = 0; ~ICustomAnimationListController()46*b1cdbd2cSJim Jagielski virtual ~ICustomAnimationListController() {} 47*b1cdbd2cSJim Jagielski }; 48*b1cdbd2cSJim Jagielski 49*b1cdbd2cSJim Jagielski class CustomAnimationList : public SvTreeListBox, public ISequenceListener 50*b1cdbd2cSJim Jagielski { 51*b1cdbd2cSJim Jagielski friend class CustomAnimationListEntryItem; 52*b1cdbd2cSJim Jagielski friend struct stl_append_effect_func; 53*b1cdbd2cSJim Jagielski 54*b1cdbd2cSJim Jagielski public: 55*b1cdbd2cSJim Jagielski CustomAnimationList( ::Window* pParent, const ResId& rResId, ICustomAnimationListController* pController ); 56*b1cdbd2cSJim Jagielski virtual ~CustomAnimationList(); 57*b1cdbd2cSJim Jagielski 58*b1cdbd2cSJim Jagielski // methods 59*b1cdbd2cSJim Jagielski 60*b1cdbd2cSJim Jagielski /** selects or deselects the given effect. 61*b1cdbd2cSJim Jagielski Selections of other effects are not changed */ 62*b1cdbd2cSJim Jagielski void select( CustomAnimationEffectPtr pEffect, bool bSelect = true ); 63*b1cdbd2cSJim Jagielski 64*b1cdbd2cSJim Jagielski /** populates the list with all effects from the given MainSequence */ 65*b1cdbd2cSJim Jagielski void update( MainSequencePtr pMainSequence ); 66*b1cdbd2cSJim Jagielski 67*b1cdbd2cSJim Jagielski /** updates the given effect in the list */ 68*b1cdbd2cSJim Jagielski // void update( CustomAnimationEffectPtr pEffect ); 69*b1cdbd2cSJim Jagielski 70*b1cdbd2cSJim Jagielski void update(); 71*b1cdbd2cSJim Jagielski 72*b1cdbd2cSJim Jagielski /** removes the given effect to the list*/ 73*b1cdbd2cSJim Jagielski // void remove( CustomAnimationEffectPtr pEffect ); 74*b1cdbd2cSJim Jagielski 75*b1cdbd2cSJim Jagielski EffectSequence getSelection() const; 76*b1cdbd2cSJim Jagielski 77*b1cdbd2cSJim Jagielski // events 78*b1cdbd2cSJim Jagielski void onSelectionChanged( ::com::sun::star::uno::Any aSelection ); 79*b1cdbd2cSJim Jagielski 80*b1cdbd2cSJim Jagielski // overrides 81*b1cdbd2cSJim Jagielski virtual void SelectHdl(); 82*b1cdbd2cSJim Jagielski virtual sal_Bool DoubleClickHdl(); 83*b1cdbd2cSJim Jagielski 84*b1cdbd2cSJim Jagielski virtual void Paint( const Rectangle& rRect ); 85*b1cdbd2cSJim Jagielski 86*b1cdbd2cSJim Jagielski virtual PopupMenu* CreateContextMenu( void ); 87*b1cdbd2cSJim Jagielski virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ); 88*b1cdbd2cSJim Jagielski 89*b1cdbd2cSJim Jagielski virtual void KeyInput( const KeyEvent& rKEvt ); 90*b1cdbd2cSJim Jagielski 91*b1cdbd2cSJim Jagielski // virtual SvLBoxEntry* CreateEntry() const; 92*b1cdbd2cSJim Jagielski virtual void SetTabs(); 93*b1cdbd2cSJim Jagielski 94*b1cdbd2cSJim Jagielski virtual void notify_change(); 95*b1cdbd2cSJim Jagielski 96*b1cdbd2cSJim Jagielski const Image& getImage( sal_uInt16 nId, bool bHighContrast ); 97*b1cdbd2cSJim Jagielski 98*b1cdbd2cSJim Jagielski bool isExpanded( const CustomAnimationEffectPtr& pEffect ) const; 99*b1cdbd2cSJim Jagielski 100*b1cdbd2cSJim Jagielski /// clears all entries from the listbox 101*b1cdbd2cSJim Jagielski void clear(); 102*b1cdbd2cSJim Jagielski 103*b1cdbd2cSJim Jagielski private: 104*b1cdbd2cSJim Jagielski bool mbIgnorePaint; 105*b1cdbd2cSJim Jagielski 106*b1cdbd2cSJim Jagielski /** appends the given effect to the list*/ 107*b1cdbd2cSJim Jagielski void append( CustomAnimationEffectPtr pEffect ); 108*b1cdbd2cSJim Jagielski 109*b1cdbd2cSJim Jagielski ICustomAnimationListController* mpController; 110*b1cdbd2cSJim Jagielski 111*b1cdbd2cSJim Jagielski MainSequencePtr mpMainSequence; 112*b1cdbd2cSJim Jagielski 113*b1cdbd2cSJim Jagielski Image maImgEmpty; 114*b1cdbd2cSJim Jagielski 115*b1cdbd2cSJim Jagielski Image maImages[ IMG_CUSTOMANIMATION_MEDIA_STOP_H - IMG_CUSTOMANIMATION_ON_CLICK + 1]; 116*b1cdbd2cSJim Jagielski 117*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxLastTargetShape; 118*b1cdbd2cSJim Jagielski sal_Int32 mnLastGroupId; 119*b1cdbd2cSJim Jagielski SvLBoxEntry* mpLastParentEntry; 120*b1cdbd2cSJim Jagielski 121*b1cdbd2cSJim Jagielski }; 122*b1cdbd2cSJim Jagielski 123*b1cdbd2cSJim Jagielski } 124*b1cdbd2cSJim Jagielski 125*b1cdbd2cSJim Jagielski #endif // _SD_CUSTOMANIMATIONLIST_HXX 126*b1cdbd2cSJim Jagielski 127