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