Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_GalleryModel.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_MODEL_H_
18 #define _FUI_CTRL_INTERNAL_GALLERY_MODEL_H_
19
20 #include <FBaseObject.h>
21 #include "FUiCtrl_ListViewModel.h"
22
23 namespace Tizen { namespace Ui { namespace Controls {
24
25 class _GalleryItem;
26 class _IGalleryItemProvider;
27 class _GalleryItemProviderAdaptor;
28
29 class _GalleryModel
30         : public Tizen::Base::Object
31 {
32 public:
33         virtual ~_GalleryModel(void);
34
35         static _GalleryModel* CreateGalleryModelN(_IGalleryItemProvider& galleryItemProvider);
36
37         result RegisterItemProviderAdaptor(_GalleryItemProviderAdaptor* pGalleryItemProviderAdaptor);
38
39         _GalleryItem* GetItem(int index) const;
40         result SetItemProvider(_IGalleryItemProvider& provider);
41         int GetItemCount(void) const;
42         int GetItemCountFromProvider(void) const;
43         void UpdateItemCount(void);
44
45         result RequestToLoadItem(int index);
46         result RequestToUnloadItem(int index);
47         result RequestToUnloadAllItems(void);
48         result RequestToUpdateItem(int itemIndex);
49         result RequestToUpdateAllItems(void);
50         result SetCacheSize(int size);
51         int GetCacheSize(void) const;
52
53         result AddGroup(void);
54
55 protected:
56         _GalleryModel(void);
57
58 private:
59         _GalleryModel(const _GalleryModel& rhs);
60         _GalleryModel& operator=(const _GalleryModel& rhs);
61
62 private:
63         _ListViewModel __listViewModel;
64         _GalleryItemProviderAdaptor* __pGalleryItemProviderAdaptor;
65         int __itemCount;
66 }; // _GalleryModel
67
68 }}} // Tizen::Ui::Controls
69
70 #endif // _FUI_CTRL_INTERNAL_GALLERY_MODEL_H_