xref: /trunk/main/svl/inc/svl/ownlist.hxx (revision 39a19a47)
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 _OWNLIST_HXX
25 #define _OWNLIST_HXX
26 
27 #include "svl/svldllapi.h"
28 #include <tools/stream.hxx>
29 #include <tools/ownlist.hxx>
30 #include <com/sun/star/uno/Sequence.hxx>
31 
32 namespace com { namespace sun { namespace star {
33 	namespace beans {
34 		struct PropertyValue;
35 	}
36 }}}
37 
38 //=========================================================================
39 class SvCommand
40 /*	[Beschreibung]
41 
42 	Enth"alt einen String, welcher das Kommando angibt und eine weiteren
43 	String, der das Argument des Kommandos bildet. W"urde solch ein
44 	Kommando "uber die Kommandozeile angegeben werden, s"ahe es wie folgt
45 	aus: Kommando = Argument.
46 */
47 {
48 	String	aCommand;
49 	String	aArgument;
50 public:
SvCommand()51 					SvCommand() {}
SvCommand(const String & rCommand,const String & rArg)52 					SvCommand( const String & rCommand, const String & rArg )
53 					{
54 						aCommand = rCommand;
55 						aArgument = rArg;
56 					}
GetCommand() const57 	const String & GetCommand() const { return aCommand; }
GetArgument() const58 	const String & GetArgument() const { return aArgument; }
59 
operator >>(SvStream & rStm,SvCommand & rThis)60 	friend SvStream& operator >> ( SvStream& rStm, SvCommand & rThis )
61 					{
62 						rStm.ReadByteString( rThis.aCommand, gsl_getSystemTextEncoding() );
63 						rStm.ReadByteString( rThis.aArgument, gsl_getSystemTextEncoding() );
64 						return rStm;
65 					}
operator <<(SvStream & rStm,const SvCommand & rThis)66 	friend SvStream& operator << ( SvStream& rStm, const SvCommand & rThis )
67 					{
68 						rStm.WriteByteString( rThis.aCommand, gsl_getSystemTextEncoding() );
69 						rStm.WriteByteString( rThis.aArgument, gsl_getSystemTextEncoding() );
70 						return rStm;
71 					}
72 };
73 
74 //=========================================================================
75 class SVL_DLLPUBLIC SvCommandList
76 /*	[Beschreibung]
77 
78 	Die Liste enth"alt Objekte vom Typ SvCommand. Wird ein Objekt
79 	eingef"ugt, dann wird es kopiert und das neue Objekt wird
80 	in die Liste gestellt.
81 */
82 {
83 					PRV_SV_DECL_OWNER_LIST(SvCommandList,SvCommand);
84 	SvCommand &		Append( const String & rCommand, const String & rArg );
85 	sal_Bool			AppendCommands( const String & rCmd, sal_uInt16 * pEaten );
86 	String  		GetCommands() const;
87 
88     sal_Bool FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
89     void FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
90 
91 	SVL_DLLPUBLIC friend SvStream& operator >> ( SvStream& rStm, SvCommandList & );
92 	SVL_DLLPUBLIC friend SvStream& operator << ( SvStream&, const SvCommandList & );
93 };
94 
95 #endif // _OWNLIST_HXX
96