xref: /aoo42x/main/ucb/source/ucp/file/filcmd.hxx (revision 6df1ea1f)
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 #ifndef _FILCMD_HXX_
24 #define _FILCMD_HXX_
25 
26 #include <rtl/ustring.hxx>
27 #include <cppuhelper/weak.hxx>
28 #include <com/sun/star/uno/XInterface.hpp>
29 #include <com/sun/star/ucb/XCommandInfo.hpp>
30 #include <com/sun/star/ucb/XContentProvider.hpp>
31 
32 
33 namespace fileaccess {
34 
35 
36 	// forward
37 	class shell;
38 
39 
40 	class XCommandInfo_impl
41 		: public cppu::OWeakObject,
42 		  public com::sun::star::ucb::XCommandInfo
43 	{
44 	public:
45 
46 		XCommandInfo_impl( shell* pMyShell );
47 
48 		virtual ~XCommandInfo_impl();
49 
50 		// XInterface
51 		virtual com::sun::star::uno::Any SAL_CALL
52 		queryInterface(
53 			const com::sun::star::uno::Type& aType )
54 			throw( com::sun::star::uno::RuntimeException);
55 
56 		virtual void SAL_CALL
57 		acquire(
58 			void )
59 			throw();
60 
61 		virtual void SAL_CALL
62 		release(
63 			void )
64 			throw();
65 
66 		// XCommandInfo
67 
68 		virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo > SAL_CALL
69 		getCommands(
70 			void )
71 			throw( com::sun::star::uno::RuntimeException);
72 
73 		virtual com::sun::star::ucb::CommandInfo SAL_CALL
74 		getCommandInfoByName(
75 			const rtl::OUString& Name )
76 			throw( com::sun::star::ucb::UnsupportedCommandException,
77 				   com::sun::star::uno::RuntimeException);
78 
79 		virtual com::sun::star::ucb::CommandInfo SAL_CALL
80 		getCommandInfoByHandle(
81 			sal_Int32 Handle )
82 			throw( com::sun::star::ucb::UnsupportedCommandException,
83 				   com::sun::star::uno::RuntimeException );
84 
85 		virtual sal_Bool SAL_CALL
86 		hasCommandByName(
87 			const rtl::OUString& Name )
88 			throw( com::sun::star::uno::RuntimeException );
89 
90 		virtual sal_Bool SAL_CALL
91 		hasCommandByHandle(
92 			sal_Int32 Handle )
93 			throw( com::sun::star::uno::RuntimeException );
94 
95 
96 	private:
97 
98 		shell*                                                                  m_pMyShell;
99 		com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider > m_xProvider;
100 	};
101 
102 }
103 
104 #endif
105