1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SD_SOURCE_UI_ANIMATIONS_CUSTOMANIMATIONLIST_HXX
21 #define INCLUDED_SD_SOURCE_UI_ANIMATIONS_CUSTOMANIMATIONLIST_HXX
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"
31 class CustomAnimationEffect
;
32 typedef boost::shared_ptr
< CustomAnimationEffect
> CustomAnimationEffectPtr
;
34 class ICustomAnimationListController
37 virtual void onSelect() = 0;
38 virtual void onDoubleClick() = 0;
39 virtual void onContextMenu( sal_uInt16 nSelectedPopupEntry
) = 0;
40 virtual ~ICustomAnimationListController() {}
43 class CustomAnimationList
: public SvTreeListBox
, public ISequenceListener
45 friend class CustomAnimationListEntryItem
;
46 friend struct stl_append_effect_func
;
49 CustomAnimationList( vcl::Window
* pParent
);
50 virtual ~CustomAnimationList();
51 virtual void dispose() SAL_OVERRIDE
;
55 /** selects or deselects the given effect.
56 Selections of other effects are not changed */
57 void select( CustomAnimationEffectPtr pEffect
, bool bSelect
= true );
59 /** populates the list with all effects from the given MainSequence */
60 void update( MainSequencePtr pMainSequence
);
64 EffectSequence
getSelection() const;
67 void onSelectionChanged(const css::uno::Any
& rSelection
);
70 virtual void SelectHdl() SAL_OVERRIDE
;
71 virtual bool DoubleClickHdl() SAL_OVERRIDE
;
73 virtual void Paint( vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) SAL_OVERRIDE
;
75 virtual PopupMenu
* CreateContextMenu() SAL_OVERRIDE
;
76 virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
) SAL_OVERRIDE
;
78 virtual void KeyInput( const KeyEvent
& rKEvt
) SAL_OVERRIDE
;
80 virtual void SetTabs() SAL_OVERRIDE
;
82 virtual void notify_change() SAL_OVERRIDE
;
84 const Image
& getImage( sal_uInt16 nId
);
86 bool isExpanded( const CustomAnimationEffectPtr
& pEffect
) const;
88 /// clears all entries from the listbox
91 void setController( ICustomAnimationListController
* pController
)
93 mpController
= pController
;
99 /** appends the given effect to the list*/
100 void append( CustomAnimationEffectPtr pEffect
);
102 ICustomAnimationListController
* mpController
;
104 MainSequencePtr mpMainSequence
;
108 Image maImages
[ IMG_CUSTOMANIMATION_MEDIA_STOP
- IMG_CUSTOMANIMATION_ON_CLICK
+ 1];
110 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> mxLastTargetShape
;
111 sal_Int32 mnLastGroupId
;
112 SvTreeListEntry
* mpLastParentEntry
;
116 OUString
getPropertyName( sal_Int32 nPropertyType
);
118 OUString
getShapeDescription( const css::uno::Reference
< css::drawing::XShape
>& xShape
, bool bWithText
= true );
122 #endif // INCLUDED_SD_SOURCE_UI_ANIMATIONS_CUSTOMANIMATIONLIST_HXX
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */