nss: upgrade to release 3.73
[LibreOffice.git] / idlc / inc / astdeclaration.hxx
blobce8f9740a745dcdfce72a3e833350176eceb1756
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_IDLC_INC_ASTDECLARATION_HXX
20 #define INCLUDED_IDLC_INC_ASTDECLARATION_HXX
22 #include "idlc.hxx"
23 #include <registry/registry.hxx>
25 class AstScope;
27 // Enum defining the different kinds of Ast nodes
28 enum NodeType
30 NT_service, // Denotes a service
31 NT_interface_member, // Denotes an interface which is exported from object
32 NT_service_member, // Denotes a service which is exported from object
33 NT_observes, // Denotes an observed interface
34 NT_needs, // Denotes a needed service
35 NT_module, // Denotes a module
36 NT_root, // Denotes the root of AST
37 NT_interface, // Denotes an interface
38 NT_constants, // Denotes a constant group
39 NT_const, // Denotes a constant
40 NT_exception, // Denotes an exception
41 NT_attribute, // Denotes an attribute
42 NT_property, // Denotes a property
43 NT_operation, // Denotes an operation
44 NT_parameter, // Denotes an op. parameter
45 NT_struct, // Denotes either a plain struct type, or a
46 // polymorphic struct type template
47 NT_type_parameter, // Denotes a type parameter of a polymorphic struct
48 // type template
49 NT_instantiated_struct, // Denotes an instantiated polymorphic struct type
50 NT_member, // Denotes a member in structure, exception
51 NT_enum, // Denotes an enumeration
52 NT_enum_val, // Denotes an enum. value
53 NT_sequence, // Denotes an IDL sequence
54 NT_typedef, // Denotes a typedef
55 NT_predefined, // Denotes a predefined type
56 NT_singleton // Denotes a singleton
59 class AstDeclaration
61 public:
62 // Constructors
63 AstDeclaration(NodeType type, const OString& name, AstScope* pScope);
64 virtual ~AstDeclaration();
66 // Data access
67 const OString& getLocalName() const
68 { return m_localName; }
69 const OString& getScopedName() const
70 { return m_scopedName; }
71 const OString& getFullName() const
72 { return m_fullName; }
73 virtual const char* getRelativName() const
74 { return m_fullName.getStr()+1; }
75 AstScope* getScope()
76 { return m_pScope; }
77 const AstScope* getScope() const
78 { return m_pScope; }
79 NodeType getNodeType() const
80 { return m_nodeType; }
81 bool isInMainfile() const
82 { return m_bInMainFile; }
83 void setInMainfile(bool bInMainfile)
84 { m_bInMainFile = bInMainfile; }
85 bool isImported() const
86 { return m_bImported; }
87 void setImported(bool bImported)
88 { m_bImported = bImported; }
89 sal_Int32 getLineNumber() const
90 { return m_lineNumber; }
91 void setLineNumber(sal_Int32 lineNumber)
92 { m_lineNumber = lineNumber; }
93 const OString& getFileName() const
94 { return m_fileName; }
95 void setFileName(const OString& rFileName)
96 { m_fileName = rFileName; }
97 const OUString& getDocumentation() const
98 { return m_documentation; }
99 void setDocumentation(const OUString& rDocumentation)
100 { m_documentation = rDocumentation; }
102 virtual bool isType() const;
104 bool hasAncestor(AstDeclaration* pDecl);
106 void setPublished() { m_bPublished = true; }
107 bool isPublished() const { return m_bPublished; }
109 virtual bool dump(RegistryKey& rKey);
111 bool isPredefined() const { return m_bPredefined; }
112 void setPredefined(bool bPredefined);
114 protected:
115 OString m_localName;
116 OString m_scopedName; // full qualified name
117 OString m_fullName; // full qualified name with '/' as separator
118 AstScope* m_pScope;
119 NodeType m_nodeType;
120 bool m_bImported; // imported ?
121 bool m_bInMainFile; // defined in main file
122 bool m_bPublished;
123 bool m_bPredefined;
124 sal_Int32 m_lineNumber; // line number defined in
125 OString m_fileName; // fileName defined in
126 OUString m_documentation; // fileName defined in
129 #endif // INCLUDED_IDLC_INC_ASTDECLARATION_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */