Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SD_SOURCE_UI_ANIMATIONS_CUSTOMANIMATIONLIST_HXX
21 : #define INCLUDED_SD_SOURCE_UI_ANIMATIONS_CUSTOMANIMATIONLIST_HXX
22 :
23 : #include <com/sun/star/drawing/XShape.hpp>
24 : #include <svtools/treelistbox.hxx>
25 : #include <CustomAnimationEffect.hxx>
26 : #include "CustomAnimationPreset.hxx"
27 : #include "CustomAnimation.hrc"
28 :
29 : namespace sd {
30 :
31 : class CustomAnimationEffect;
32 : typedef boost::shared_ptr< CustomAnimationEffect > CustomAnimationEffectPtr;
33 :
34 0 : class ICustomAnimationListController
35 : {
36 : public:
37 : virtual void onSelect() = 0;
38 : virtual void onDoubleClick() = 0;
39 : virtual void onContextMenu( sal_uInt16 nSelectedPopupEntry ) = 0;
40 0 : virtual ~ICustomAnimationListController() {}
41 : };
42 :
43 : class CustomAnimationList : public SvTreeListBox, public ISequenceListener
44 : {
45 : friend class CustomAnimationListEntryItem;
46 : friend struct stl_append_effect_func;
47 :
48 : public:
49 : CustomAnimationList( vcl::Window* pParent );
50 : virtual ~CustomAnimationList();
51 : virtual void dispose() SAL_OVERRIDE;
52 :
53 : // methods
54 :
55 : /** selects or deselects the given effect.
56 : Selections of other effects are not changed */
57 : void select( CustomAnimationEffectPtr pEffect, bool bSelect = true );
58 :
59 : /** populates the list with all effects from the given MainSequence */
60 : void update( MainSequencePtr pMainSequence );
61 :
62 : void update();
63 :
64 : EffectSequence getSelection() const;
65 :
66 : // events
67 : void onSelectionChanged(const css::uno::Any& rSelection);
68 :
69 : // overrides
70 : virtual void SelectHdl() SAL_OVERRIDE;
71 : virtual bool DoubleClickHdl() SAL_OVERRIDE;
72 :
73 : virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
74 :
75 : virtual PopupMenu* CreateContextMenu() SAL_OVERRIDE;
76 : virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) SAL_OVERRIDE;
77 :
78 : virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
79 :
80 : virtual void SetTabs() SAL_OVERRIDE;
81 :
82 : virtual void notify_change() SAL_OVERRIDE;
83 :
84 : const Image& getImage( sal_uInt16 nId );
85 :
86 : bool isExpanded( const CustomAnimationEffectPtr& pEffect ) const;
87 :
88 : /// clears all entries from the listbox
89 : void clear();
90 :
91 0 : void setController( ICustomAnimationListController* pController )
92 : {
93 0 : mpController = pController;
94 0 : };
95 :
96 : private:
97 : bool mbIgnorePaint;
98 :
99 : /** appends the given effect to the list*/
100 : void append( CustomAnimationEffectPtr pEffect );
101 :
102 : ICustomAnimationListController* mpController;
103 :
104 : MainSequencePtr mpMainSequence;
105 :
106 : Image maImgEmpty;
107 :
108 : Image maImages[ IMG_CUSTOMANIMATION_MEDIA_STOP - IMG_CUSTOMANIMATION_ON_CLICK + 1];
109 :
110 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxLastTargetShape;
111 : sal_Int32 mnLastGroupId;
112 : SvTreeListEntry* mpLastParentEntry;
113 :
114 : };
115 :
116 : OUString getPropertyName( sal_Int32 nPropertyType );
117 :
118 : OUString getShapeDescription( const css::uno::Reference< css::drawing::XShape >& xShape, bool bWithText = true );
119 :
120 : }
121 :
122 : #endif // INCLUDED_SD_SOURCE_UI_ANIMATIONS_CUSTOMANIMATIONLIST_HXX
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|