Klockwork fixes: Distance field iteration
[platform/core/uifw/dali-core.git] / dali / internal / event / text / resource / glyph-resource-request.h
1 #ifndef __DALI_INTERNAL_GLYPH_RESOURCE_REQUEST_H__
2 #define __DALI_INTERNAL_GLYPH_RESOURCE_REQUEST_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/internal/event/text/resource/font-id.h>
24 #include <dali/integration-api/resource-cache.h>
25
26 namespace Dali
27 {
28
29 namespace Internal
30 {
31
32 /**
33  * Structure for requesting an array of characters to be loaded
34  * at a certain quality, for a certain font.
35  * Resource requests are generated by glyph-atlas
36  */
37 class GlyphResourceRequest
38 {
39 public:
40   typedef Integration::TextResourceType::CharacterList CharacterList;
41   typedef Integration::ResourceId ResourceId;
42
43   /**
44    * Glyph quality
45    */
46   enum GlyphQuality
47   {
48     LOW_QUALITY,
49     HIGH_QUALITY
50   };
51
52   /**
53    * Constructor
54    * @param[in] fontId font id
55    * @param[in] quality
56    */
57   GlyphResourceRequest( FontId fontId, GlyphQuality quality );
58
59   /**
60    * non-virtual destructor
61    */
62   ~GlyphResourceRequest()
63   {
64   }
65
66   /**
67    * Copy constructor
68    */
69   GlyphResourceRequest( const GlyphResourceRequest& );
70
71   /**
72    * Assignment operator
73    */
74   GlyphResourceRequest& operator=( const GlyphResourceRequest& );
75
76   /**
77    * Get the font id
78    * @return the font id of the request
79    */
80   FontId GetFontId() const;
81
82   /**
83    * Get the request quality
84    * @return quality
85    */
86   GlyphQuality GetQuality() const;
87
88   /**
89    * Inserts a character in to the request
90    * @param[in] code character code
91    */
92   void InsertCharacter( unsigned int code, unsigned int xPos, unsigned int yPos );
93
94   /**
95    * Get the character list in the request
96    * @return character list
97    */
98   const CharacterList& GetCharacterList() const;
99
100 private:
101
102   /**
103    * constructor
104    */
105   GlyphResourceRequest();
106
107   FontId mFontId;                  ///< font id
108   GlyphQuality mQuality;           ///< quality
109   CharacterList mCharacterList;    ///< character list
110 };
111
112 typedef std::vector< GlyphResourceRequest > GlyphRequestList;
113
114 } // namespace Internal
115
116 } // namespace Dali
117
118 #endif // __DALI_INTERNAL_GLYPH_RESOURCE_REQUEST_H__