OSDN Git Service

cc622e476336f765d339bbae7628b41d0ed3d5a8
[moflib/moflib.git] / moflib-1.0 / moflib / moflib / mof / widget / Frame.hpp
1 #pragma once
2 #include <boost/scoped_ptr.hpp>
3 #include <memory>
4 #include <mof/widget/Widget.hpp>
5 #include <mof/FactoryMethod.hpp>
6 #include <mof/widget/AbstractTextCompiler.hpp>
7
8 namespace mof
9 {
10     class Font;
11
12 namespace widget
13 {
14
15     class Frame : public Widget
16     {
17     public:
18                 enum BehaviorTarget
19                 {
20                         FRAME_OPEN,
21                         FRAME_CLOSE,
22                 };
23
24
25         Frame
26         (
27             const tstring& title ,
28             std::shared_ptr<WidgetView> content ,
29             const FactoryMethod<WidgetView>& contentBackground ,
30             const FactoryMethod<WidgetView>& titleBackground,
31                         const FactoryMethod<AbstractTextCompiler>& text_compiler
32         );
33         virtual ~Frame();
34                 virtual FrameNumber show(bool imidiately = false);
35                 virtual FrameNumber hide(bool imidiately = false);
36         virtual const std::shared_ptr<WidgetView> getView( ) const;
37         virtual std::shared_ptr<WidgetView> getView( );
38                 virtual void update();
39         
40         void setCaption(const tstring& title);
41                 void setBehaviorOnPosition(BehaviorTarget, mof::Manipulator<mof::Vector2D>::Handler position, FrameNumber period);
42                 void setBehaviorOnSize(BehaviorTarget, mof::Manipulator<mof::Vector2D>::Handler size, FrameNumber period);
43                 void setBehaviorOnColor(BehaviorTarget, mof::Manipulator<mof::Color4f>::Handler color, FrameNumber period);
44
45         
46     protected:
47         struct Impl;
48         boost::scoped_ptr<Impl> m_pImpl;
49
50     };
51
52
53 } // namespace widget
54 } // namespace mof