4d79c40a736df23a9cb7636d46703d602196befb
[profile/ivi/ico-uxf-homescreen.git] / src / statusbar / CicoModuleImplementation.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoModuleInterface.h
13  *
14  *  @brief  This file is definition of CicoModuleInterface class
15  */
16 //==========================================================================
17 #ifndef __CICO_MODULE_IMPLEMENTATION_H__
18 #define __CICO_MODULE_IMPLEMENTATION_H__
19
20 #include <Evas.h>
21 #include "CicoModuleInterface.h"
22
23 //==========================================================================
24 /**
25  *  @brief  This class provide the common module component interfaces
26  */
27 //==========================================================================
28 class CicoCommonModule : public CicoModuleInterface
29 {
30 public:
31     // default constructor
32     CicoCommonModule();
33
34     // destructor
35     virtual ~CicoCommonModule();
36
37     // terminate module 
38     virtual bool Terminate(void);
39
40     // show module
41     virtual void Show(void);
42
43     // hide module
44     virtual void Hide(void);
45
46     // set position of module
47     virtual void SetPos(int x, int y);
48
49     // set size of module
50     virtual void SetSize(int w, int h);
51
52     // move module
53     virtual void Move(int diffx, int diffy);
54
55     // resize module
56     virtual void Resize(double ratew, double rateh);
57
58     // reset position and size of module
59     virtual void Reallocate(int standardx, int standardy,
60                             double ratew, double rateh);
61
62     // get raw data
63     Evas_Object *GetRawData(void) const;
64     bool operator==(const CicoCommonModule& moduleb) {
65         return (this->evasobj_ == moduleb.evasobj_);
66     }
67
68 protected:
69     Evas_Object *evasobj_;  /// module object
70     int posx_;              /// module position x
71     int posy_;              /// module position y
72     int width_;             /// module width
73     int height_;            /// module height
74 };
75
76 //==========================================================================
77 /**
78  *  @brief  This class provide the image module
79  */
80 //==========================================================================
81 class CicoImageModule : public CicoCommonModule
82 {
83 public:
84     // default constructor
85     CicoImageModule();
86
87     // destructor
88     virtual ~CicoImageModule();
89
90     // initialize of image module
91     bool Initialize(Evas_Object *windowobj);
92
93     // set filepath of image module
94     bool SetFilePath(const char *path);
95 protected:
96     char filepath_[256];    ///image file path
97 };
98
99 //==========================================================================
100 /**
101  *  @brief  This class provide the text module
102  */
103 //==========================================================================
104 class CicoTextModule : public CicoCommonModule
105 {
106 public:
107     // default contructor
108     CicoTextModule();
109
110     // destructor
111     ~CicoTextModule();
112
113     // initialize of text module
114     bool Initialize(Evas_Object *windowobj);
115
116     // set text of text module
117     bool SetText(const char *text);
118
119     // set font of text module
120     void SetFont(const char *style, const int size);
121
122     // set color of text module
123     void SetColor(const int r, const int g, const int b, const int a);
124 protected:
125     static const double FONT_SIZE_RATE; /// rate of font size
126     char text_[256];                    /// text of textmodule
127     char fontstyle_[256];               /// font style of textmodule
128     int fontsize_;                      /// font size of textmodule
129 };
130 #endif  //  __CICO_MODULE_IMPLEMENTATION_H__
131 // vim: set expandtab ts=4 sw=4: