Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / text / FGrp_TextTextCutLinkParser.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_TextTextCutLinkParser.h
20  * @brief       This file contains the declarations of TextCutLinkParser class.
21  */
22
23 #ifndef _FGRP_INTERNAL_TEXT_CUTLINK_PARSER_H_
24 #define _FGRP_INTERNAL_TEXT_CUTLINK_PARSER_H_
25
26 #include <FBaseTypes.h>
27 #include <FBaseObject.h>
28 #include <FBaseColArrayListT.h>
29 #include <FBaseColArrayList.h>
30 #include <FBaseUtilTypes.h>
31 #include <FBaseUtilLinkInfo.h>
32
33 struct TextLinkInfo
34 {
35         int index;
36         int srcOffset;
37         int length;
38         Tizen::Base::Utility::LinkType linkType;
39
40         struct TextLinkInfo* pNextLinkInfo;
41 };
42
43 namespace Tizen { namespace Graphics
44 {
45
46 namespace _Text
47 {
48
49 class TextCutLinkParser
50         : public Tizen::Base::Object
51 {
52 public:
53         TextCutLinkParser(void);
54
55         virtual ~TextCutLinkParser(void);
56
57 public:
58         TextLinkInfo* Parse(const wchar_t* pText, int textLength, int textStartIndex);
59
60         result SetCutLinkMask(int mask);
61
62         int GetCutLinkMask(void) const;
63
64 private:
65         bool AppendTextLinkInfo(TextLinkInfo* pLinkInfo, TextLinkInfo* pNewLinkInfo);
66
67         TextLinkInfo* CreateTextLinkInfo(int offset, int length, Tizen::Base::Utility::LinkType linkType);
68
69 private:
70         int __linkMask;
71
72 private:
73         TextCutLinkParser(const TextCutLinkParser& other); // NOT IMPLEMENTED
74
75         TextCutLinkParser& operator =(const TextCutLinkParser& rhs); // NOT IMPLEMENTED
76
77 }; // _TextLinkParser
78
79 }}} // Tizen::Graphics::_Text
80
81 #endif // _FGRP_INTERNAL_TEXT_CUTLINK_PARSER_H_