update dev300-m58
[ooovba.git] / transex3 / inc / wtranode.hxx
blob899aee6080bdae963cd5abaa2c81f5110c0f7913
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: wtranode.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef TX3_WTRANODE_HXX
33 #define TX3_WTRANODE_HXX
35 // USED
36 // Base Classes
37 // Components
38 // Parameters
39 #include <tools/string.hxx>
42 typedef UINT8 BRANCH_T;
46 const BRANCH_T C_BR_ALPHABASE = 4;
47 const BRANCH_T C_NR_OF_BRANCHES = 34;
52 /** @task
53 This is a node of the parsing-tree which implements the fuctionality of
54 class WordTransTree.
55 WordTransTree is dependant of this class, but NOT the other way!
56 **/
57 class WTT_Node // WordTransTree-Node
59 public:
60 enum E_TokenType
62 // no_token = 0,
63 token_to_keep,
64 token_to_replace
67 // LIFECYCLE
68 WTT_Node(
69 UINT8 i_nValue, // Own branch-value.
70 WTT_Node * i_pDefaultBranch,
71 WTT_Node * i_pDefaultBranchForAlphas );
72 void SetBranch(
73 UINT8 i_cBranch,
74 WTT_Node * i_pNode );
75 void SetAsTokenToReplace(
76 const ByteString & i_sReplaceString );
77 ~WTT_Node();
79 // OPERATIONS
80 WTT_Node * GetNextNode(
81 UINT8 i_cBranch ); /// [0 .. C_NR_OF_BRANCHES-1], sonst GPF !!!
83 // INQUIRY
84 E_TokenType TokenType() const;
85 UINT8 Value() const;
86 BOOL IsOnDeleting() const;
87 const ByteString & ReplaceString() const;
89 private:
90 // DATA
91 UINT8 nValue;
92 E_TokenType eType;
93 ByteString sReplaceString;
94 WTT_Node * aBranches[C_NR_OF_BRANCHES]; // Mostly DYN pointers.
95 char bIsOnDeleting;
99 inline WTT_Node *
100 WTT_Node::GetNextNode(UINT8 i_cBranch)
101 { return aBranches[i_cBranch]; }
102 inline WTT_Node::E_TokenType
103 WTT_Node::TokenType() const
104 { return eType; }
105 inline UINT8
106 WTT_Node::Value() const
107 { return nValue; }
108 inline BOOL
109 WTT_Node::IsOnDeleting() const
110 { return bIsOnDeleting; }
111 inline const ByteString &
112 WTT_Node::ReplaceString() const
113 { return sReplaceString; }
118 #endif