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