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