Tizen 2.0 Release
[apps/osp/Internet.git] / inc / IntFaviconManager.h
1 //
2
3 // Copyright (c) 2012 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
18 //!Internet
19 /*@file: IntFaviconManager.h
20  *@brief: This is the header file for FaviconManager class
21  */
22
23
24 #ifndef _FAVICON_MANAGER_H
25 #define _FAVICON_MANAGER_H
26
27 #include <FAppApp.h>
28 #include <FApp.h>
29 #include <FBase.h>
30 #include <FGraphics.h>
31 #include <FIo.h>
32 #include <FMedia.h>
33
34 #include "IntTypes.h"
35 #include "IntPresentationModelBase.h"
36
37 /**
38  * @class FaviconManager
39  * @brief This class declares functions which will manage Favicon
40  */
41 class FaviconManager
42 :public PresentationModelBase
43  {
44
45 public:
46         /**
47          * @brief               The method used to get the already created instance of the FaviconManager
48          */
49         static FaviconManager* GetInstance(void);
50
51         /**
52          * This function selects the favicons from the table
53          *
54          * @return      A Bitmap Pointer
55          * @param               no parameters
56          */
57         Tizen::Graphics::Bitmap* GetDefaultFaviconN(void);
58
59         /**
60          * This function selects the favicons from the table
61          *
62          * @return      A Bitmap Pointer
63          * @param               ID                              the Favicon ID
64          */
65         Tizen::Graphics::Bitmap* GetFaviconN(Tizen::Base::String& ID);
66
67         /**
68          * This function adds the favicons to the Favicon table
69          *
70          * @return      String Type
71          * @param               bitmap                  The bitmap for favicon
72          * @param               URL                             The URL for the corresponding favicon
73          */
74         Tizen::Base::String SaveFavicon(Tizen::Graphics::Bitmap& bitmap, Tizen::Base::String& URL);
75
76
77 private:
78         /**
79          * @brief The Default Constructor
80          */
81         FaviconManager(void);
82
83         /**
84         * @brief                The Default Destructor
85         */
86         ~FaviconManager(void);
87
88         /**
89          * copy constructor
90          */
91         FaviconManager(const FaviconManager& settingModelObj);
92
93         /**
94          * assignment operator
95          */
96
97         FaviconManager& operator=(const FaviconManager& settingModelObj);
98
99         /**
100          *@brief Initialize storage service
101          */
102         result Construct(void);
103
104         /**
105          * @brief               The method used to create the instance of the SettingsManager class
106          */
107         static void CreateInstance(void);
108
109         /**
110          * @brief               The method used to remove the already created instance of the SettingsManager
111          */
112         static void DestroyInstance(void);
113
114         /**
115          * This function generates the filename
116          *
117          * @return      Filename
118          * @param               none
119          */
120         Tizen::Base::String GenerateFileName(void);
121
122         /**
123          * This function generates the filename
124          *
125          * @return      void
126          * @param               bitmap     The bitmap
127          *              filePath   The path where bitmap is supposed to be saved
128          */
129         void SaveBitmapToFile(Tizen::Graphics::Bitmap& bitmap, Tizen::Base::String& filePath);
130
131
132 private:
133         static Tizen::Graphics::Bitmap* __pDefaultBitmap;
134         static FaviconManager* __pFaviconManagerInstance;
135  };
136
137 #endif // _FAVICON_MANAGER_H