Update ooo320-m1
[ooovba.git] / sd / source / ui / animations / CustomAnimationList.hxx
blobe7e08dfe57cdd9fa7dda9b505aa01fec7a4676cf
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: CustomAnimationList.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SD_CUSTOMANIMATIONLIST_HXX
32 #define _SD_CUSTOMANIMATIONLIST_HXX
34 #include <com/sun/star/drawing/XShape.hpp>
35 #include <svtools/svtreebx.hxx>
36 #include <CustomAnimationEffect.hxx>
37 #include "CustomAnimationPreset.hxx"
38 #ifndef _SD_CUSTOMANIMATION_HRC
39 #include "CustomAnimation.hrc"
40 #endif
42 namespace sd {
44 class CustomAnimationEffect;
45 typedef boost::shared_ptr< CustomAnimationEffect > CustomAnimationEffectPtr;
47 class ICustomAnimationListController
49 public:
50 virtual void onSelect() = 0;
51 virtual void onDoubleClick() = 0;
52 virtual void onContextMenu( USHORT nSelectedPopupEntry ) = 0;
55 class CustomAnimationList : public SvTreeListBox, public ISequenceListener
57 friend class CustomAnimationListEntryItem;
58 friend struct stl_append_effect_func;
60 public:
61 CustomAnimationList( ::Window* pParent, const ResId& rResId, ICustomAnimationListController* pController );
62 virtual ~CustomAnimationList();
64 // methods
66 /** selects or deselects the given effect.
67 Selections of other effects are not changed */
68 void select( CustomAnimationEffectPtr pEffect, bool bSelect = true );
70 /** populates the list with all effects from the given MainSequence */
71 void update( MainSequencePtr pMainSequence );
73 /** updates the given effect in the list */
74 // void update( CustomAnimationEffectPtr pEffect );
76 void update();
78 /** removes the given effect to the list*/
79 // void remove( CustomAnimationEffectPtr pEffect );
81 EffectSequence getSelection() const;
83 // events
84 void onSelectionChanged( ::com::sun::star::uno::Any aSelection );
86 // overrides
87 virtual void SelectHdl();
88 virtual BOOL DoubleClickHdl();
90 virtual void Paint( const Rectangle& rRect );
92 virtual PopupMenu* CreateContextMenu( void );
93 virtual void ExcecuteContextMenuAction( USHORT nSelectedPopupEntry );
95 virtual void KeyInput( const KeyEvent& rKEvt );
97 // virtual SvLBoxEntry* CreateEntry() const;
98 virtual void SetTabs();
100 virtual void notify_change();
102 const Image& getImage( USHORT nId, bool bHighContrast );
104 bool isExpanded( const CustomAnimationEffectPtr& pEffect ) const;
106 /// clears all entries from the listbox
107 void clear();
109 private:
110 bool mbIgnorePaint;
112 /** appends the given effect to the list*/
113 void append( CustomAnimationEffectPtr pEffect );
115 ICustomAnimationListController* mpController;
117 MainSequencePtr mpMainSequence;
119 Image maImgEmpty;
121 Image maImages[ IMG_CUSTOMANIMATION_MEDIA_STOP_H - IMG_CUSTOMANIMATION_ON_CLICK + 1];
123 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxLastTargetShape;
124 sal_Int32 mnLastGroupId;
125 SvLBoxEntry* mpLastParentEntry;
131 #endif // _SD_CUSTOMANIMATIONLIST_HXX