Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_GalleryImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 #ifndef _FUI_CTRL_INTERNAL_GALLERY_IMPL_H_
18 #define _FUI_CTRL_INTERNAL_GALLERY_IMPL_H_
19
20 #include <FUiCtrlGalleryTypes.h>
21 #include "FUi_ControlImpl.h"
22 #include "FUiCtrl_Gallery.h"
23
24 namespace Tizen { namespace Ui { namespace Effects
25 {
26 class Effect;
27 }}}
28
29 namespace Tizen { namespace Ui { namespace Controls {
30
31 class Gallery;
32 class IGalleryItemProvider;
33 class IGalleryEventListener;
34 class _GalleryImplEvent;
35 class _GalleryCoreEventListener;
36 class _GalleryItemProviderAdaptorImpl;
37
38 class _GalleryImpl
39         : public Tizen::Ui::_ControlImpl
40 {
41 public:
42         virtual ~_GalleryImpl(void);
43
44         static _GalleryImpl* CreateGalleryImplN(Gallery* pGallery);
45
46         virtual const char* GetPublicClassName(void) const;
47         virtual const Gallery& GetPublic(void) const;
48         virtual Gallery& GetPublic(void);
49         virtual const _Gallery& GetCore(void) const;
50         virtual _Gallery& GetCore(void);
51
52         void AddGalleryEventListener(IGalleryEventListener& listener);
53         void RemoveGalleryEventListener(IGalleryEventListener& listener);
54         result SetItemProvider(IGalleryItemProvider& provider);
55
56         result SetCurrentItemIndex(int index);
57         int GetCurrentItemIndex(void) const;
58         result SetZoomingEnabled(bool enable);
59         bool IsZoomingEnabled(void) const;
60
61         result SetTextOfEmptyGallery(const Tizen::Base::String& text);
62         Tizen::Base::String GetTextOfEmptyGallery(void) const;
63         result SetBitmapOfEmptyGallery(const Tizen::Graphics::Bitmap* pBitmap);
64
65         result SetSlideShowAnimation(GalleryAnimation animation);
66         GalleryAnimation GetSlideShowAnimation(void) const;
67         result SetSlideShowAnimationDuration(int duration);
68         int GetSlideShowAnimationDuration(void) const;
69         result SetSlideShowViewDuration(int duration);
70         int GetSlideShowViewDuration(void) const;
71
72         result StartSlideShow(bool repeat = false);
73         result StopSlideShow(void) const;
74         bool IsSlideShowStarted(void) const;
75
76         int GetItemCount(void) const;
77
78         result RefreshGallery(int itemIndex, GalleryRefreshType type);
79         result UpdateGallery(void);
80
81         static _GalleryImpl* GetInstance(Gallery& gallery);
82         static const _GalleryImpl* GetInstance(const Gallery& gallery);
83
84         void SetEffect(Tizen::Ui::Effects::Effect* pEffect);
85         Tizen::Ui::Effects::Effect* GetEffect(void);
86
87 protected:
88         _GalleryImpl(Gallery* pGallery, _Gallery* pCore, _GalleryImplEvent* pImplEvent,
89                         _GalleryCoreEventListener* pCoreEventListener, _GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor);
90
91 private:
92         _GalleryImpl(const _GalleryImpl& rhs);
93         _GalleryImpl& operator=(const _GalleryImpl& rhs);
94
95         void RequestToUnloadAllItems(void);
96
97 private:
98         _GalleryImplEvent* __pImplEvent;
99         _GalleryCoreEventListener* __pCoreEventListener;
100         _GalleryItemProviderAdaptorImpl* __pGalleryItemProviderAdaptor;
101 }; //_GalleryImpl
102
103 }}} //Tizen::Ui::Controls
104
105 #endif //_FUI_CTRL_INTERNAL_GALLERY_IMPL_H_