xref: /aoo4110/main/idl/inc/module.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  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,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _MODULE_HXX
25 #define _MODULE_HXX
26 
27 #include <slot.hxx>
28 #include <object.hxx>
29 
30 struct SvNamePos
31 {
32 	SvGlobalName	aUUId;
33 	sal_uInt32  		nStmPos;
SvNamePosSvNamePos34 	SvNamePos( const SvGlobalName & rName, sal_uInt32 nPos )
35 		: aUUId( rName )
36 		, nStmPos( nPos ) {}
37 };
38 DECLARE_LIST( SvNamePosList, SvNamePos *)
39 
40 /******************** class SvMetaModule *********************************/
41 class SvMetaModule : public SvMetaExtern
42 {
43     SvMetaClassMemberList   	aClassList;
44     SvMetaTypeMemberList    	aTypeList;
45     SvMetaAttributeMemberList   aAttrList;
46 // Browser
47     String                  aIdlFileName;
48     SvString                aHelpFileName;
49     SvString                aSlotIdFile;
50     SvString                aTypeLibFile;
51 	SvString				aModulePrefix;
52 
53 #ifdef IDL_COMPILER
54     sal_Bool                    bImported   : 1,
55                             bIsModified : 1;
56     SvGlobalName            aBeginName;
57     SvGlobalName            aEndName;
58     SvGlobalName            aNextName;
59 protected:
60 	virtual void        ReadAttributesSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
61     virtual void        WriteAttributesSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
62     virtual void        ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
63     virtual void        WriteContextSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
64 #endif
65 public:
66                         SV_DECL_META_FACTORY1( SvMetaModule, SvMetaExtern, 13 )
67                         SvMetaModule();
68 
GetIdlFileName() const69     const String &      GetIdlFileName() const { return aIdlFileName; }
GetModulePrefix() const70 	const ByteString &  	GetModulePrefix() const { return aModulePrefix; }
71 
72     virtual sal_Bool        SetName( const ByteString & rName, SvIdlDataBase * = NULL  );
73 
GetHelpFileName() const74     const ByteString &      GetHelpFileName() const { return aHelpFileName; }
GetTypeLibFileName() const75     const ByteString &      GetTypeLibFileName() const { return aTypeLibFile; }
76 
GetAttrList() const77     const SvMetaAttributeMemberList & GetAttrList() const { return aAttrList; }
GetTypeList() const78     const SvMetaTypeMemberList & GetTypeList() const { return aTypeList; }
GetClassList() const79     const SvMetaClassMemberList & GetClassList() const { return aClassList; }
80 
81 #ifdef IDL_COMPILER
82                         SvMetaModule( const String & rIdlFileName,
83                                       sal_Bool bImported );
84 
85     sal_Bool                FillNextName( SvGlobalName * );
IsImported() const86     sal_Bool                IsImported() const { return bImported; }
IsModified() const87     sal_Bool                IsModified() const { return bIsModified; }
88 
89     virtual sal_Bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
90     virtual void        WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
91 
92 	virtual void		WriteAttributes( SvIdlDataBase & rBase,
93 										SvStream & rOutStm, sal_uInt16 nTab,
94 		 						   		WriteType, WriteAttribute = 0 );
95 //    virtual void        WriteSbx( SvIdlDataBase & rBase, SvStream & rOutStm, SvNamePosList & rList );
96     virtual void        Write( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
97 	 						   	WriteType, WriteAttribute = 0 );
98     virtual void        WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
99     virtual void        WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
100 									Table* pTable );
101     virtual void        WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
102                                   	Table *pIdTable );
103 
104 	virtual void        WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
105 	virtual void        WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
106 #endif
107 };
108 SV_DECL_IMPL_REF(SvMetaModule)
109 SV_DECL_IMPL_PERSIST_LIST(SvMetaModule,SvMetaModule *)
110 
111 
112 #endif // _MODULE_HXX
113 
114