xref: /aoo41x/main/idl/inc/module.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _MODULE_HXX
29 #define _MODULE_HXX
30 
31 #include <slot.hxx>
32 #include <object.hxx>
33 
34 struct SvNamePos
35 {
36 	SvGlobalName	aUUId;
37 	sal_uInt32  		nStmPos;
38 	SvNamePos( const SvGlobalName & rName, sal_uInt32 nPos )
39 		: aUUId( rName )
40 		, nStmPos( nPos ) {}
41 };
42 DECLARE_LIST( SvNamePosList, SvNamePos *)
43 
44 /******************** class SvMetaModule *********************************/
45 class SvMetaModule : public SvMetaExtern
46 {
47     SvMetaClassMemberList   	aClassList;
48     SvMetaTypeMemberList    	aTypeList;
49     SvMetaAttributeMemberList   aAttrList;
50 // Browser
51     String                  aIdlFileName;
52     SvString                aHelpFileName;
53     SvString                aSlotIdFile;
54     SvString                aTypeLibFile;
55 	SvString				aModulePrefix;
56 
57 #ifdef IDL_COMPILER
58     sal_Bool                    bImported   : 1,
59                             bIsModified : 1;
60     SvGlobalName            aBeginName;
61     SvGlobalName            aEndName;
62     SvGlobalName            aNextName;
63 protected:
64 	virtual void        ReadAttributesSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
65     virtual void        WriteAttributesSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
66     virtual void        ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
67     virtual void        WriteContextSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
68 #endif
69 public:
70                         SV_DECL_META_FACTORY1( SvMetaModule, SvMetaExtern, 13 )
71                         SvMetaModule();
72 
73     const String &      GetIdlFileName() const { return aIdlFileName; }
74 	const ByteString &  	GetModulePrefix() const { return aModulePrefix; }
75 
76     virtual sal_Bool        SetName( const ByteString & rName, SvIdlDataBase * = NULL  );
77 
78     const ByteString &      GetHelpFileName() const { return aHelpFileName; }
79     const ByteString &      GetTypeLibFileName() const { return aTypeLibFile; }
80 
81     const SvMetaAttributeMemberList & GetAttrList() const { return aAttrList; }
82     const SvMetaTypeMemberList & GetTypeList() const { return aTypeList; }
83     const SvMetaClassMemberList & GetClassList() const { return aClassList; }
84 
85 #ifdef IDL_COMPILER
86                         SvMetaModule( const String & rIdlFileName,
87                                       sal_Bool bImported );
88 
89     sal_Bool                FillNextName( SvGlobalName * );
90     sal_Bool                IsImported() const { return bImported; }
91     sal_Bool                IsModified() const { return bIsModified; }
92 
93     virtual sal_Bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
94     virtual void        WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
95 
96 	virtual void		WriteAttributes( SvIdlDataBase & rBase,
97 										SvStream & rOutStm, sal_uInt16 nTab,
98 		 						   		WriteType, WriteAttribute = 0 );
99 //    virtual void        WriteSbx( SvIdlDataBase & rBase, SvStream & rOutStm, SvNamePosList & rList );
100     virtual void        Write( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
101 	 						   	WriteType, WriteAttribute = 0 );
102     virtual void        WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
103     virtual void        WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
104 									Table* pTable );
105     virtual void        WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
106                                   	Table *pIdTable );
107 
108 	virtual void        WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
109 	virtual void        WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
110 #endif
111 };
112 SV_DECL_IMPL_REF(SvMetaModule)
113 SV_DECL_IMPL_PERSIST_LIST(SvMetaModule,SvMetaModule *)
114 
115 
116 #endif // _MODULE_HXX
117 
118