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