Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / text / FGrp_TextTextSimpleList.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
18 /*
19  * @file        FGrp_TextTextSimpleList.h
20  * @brief       This is the header file for the TextSimpleList class.
21  *
22  * This header file contains the declarations of the %TextSimpleList class.
23  */
24
25 #ifndef _FGRP_INTERNAL_TEXT_SIMPLE_LIST_H_
26 #define _FGRP_INTERNAL_TEXT_SIMPLE_LIST_H_
27
28 namespace Tizen { namespace Graphics
29 {
30
31 namespace _Text
32 {
33 struct SimpleNode
34 {
35         struct SimpleNode* pNext;
36         struct SimpleNode* pPrev;
37         void* pObject;
38 };
39
40 struct SimpleList
41 {
42         SimpleNode* pHeaderNode;
43         SimpleNode* pTailNode;
44         int nodeCount;
45 };
46
47 class TextSimpleList
48 {
49 public:
50         static SimpleList* Create(void);
51
52         static bool Destory(SimpleList* pSimpleList);
53
54         static bool Init(SimpleList* pSimpleList);
55
56         static SimpleNode* InsertObject(SimpleList* pSimpleList, void* pObject, int index);
57
58         static SimpleNode* AddObject(SimpleList* pSimpleList, void* pObject);
59
60         static SimpleNode* AppendObject(SimpleList* pSimpleList, void* pObject);
61
62         static bool DeleteNode(SimpleList* pSimpleList, SimpleNode* pNode);
63
64         static void* DeleteNthObject(SimpleList* pSimpleList, int index);
65
66         static bool DeleteAllObject(SimpleList* pSimpleList);
67
68         static SimpleNode* InsertObjectAfterNode(SimpleList* pSimpleList, SimpleNode* pSimpleNode, void* pObject);
69
70         static SimpleNode* InsertObjectBeforeNode(SimpleList* pSimpleList, SimpleNode* pSimpleNode, void* pObject);
71
72         static int GetCount(SimpleList* pSimpleList);
73
74         static SimpleNode* GetFirstNode(SimpleList* pSimpleList);
75
76         static SimpleNode* GetLastNode(SimpleList* pSimpleList);
77
78         static SimpleNode* GetNthNode(SimpleList* pSimpleList, int index);
79
80         static void* GetFirstObject(SimpleList* pSimpleList);
81
82         static void* GetNthObject(SimpleList* pSimpleList, int index);
83
84         static int GetObjectIndex(SimpleList* pSimpleList, void* pObject);
85
86         static bool IsEmpty(SimpleList* pSimpleList);
87
88 }; // SimpleList
89
90 }}} // Tizen::Graphics::_Text
91
92 #endif // _FGRP_INTERNAL_TEXT_SIMPLE_LIST_H_