Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #ifndef _CONTENT_HXX
21 : : #define _CONTENT_HXX
22 : :
23 : : #include <ucbhelper/contenthelper.hxx>
24 : : #include <com/sun/star/io/XInputStream.hpp>
25 : :
26 : : #include "urlparameter.hxx"
27 : :
28 : : namespace com { namespace sun { namespace star { namespace beans {
29 : : struct Property;
30 : : struct PropertyValue;
31 : : } } } }
32 : :
33 : : namespace com { namespace sun { namespace star { namespace sdbc {
34 : : class XRow;
35 : : } } } }
36 : :
37 : : namespace chelp
38 : : {
39 : :
40 : : //=========================================================================
41 : :
42 : : // UNO service name for the content.
43 : : #define MYUCP_CONTENT_SERVICE_NAME \
44 : : "com.sun.star.ucb.CHelpContent"
45 : :
46 : : //=========================================================================
47 : :
48 : : class Databases;
49 : :
50 : 593 : struct ContentProperties
51 : : {
52 : : ::rtl::OUString aTitle; // Title
53 : : ::rtl::OUString aContentType; // ContentType
54 : : sal_Bool bIsDocument; // IsDocument
55 : : sal_Bool bIsFolder; // IsFolder
56 : :
57 : 593 : ContentProperties()
58 : 593 : : bIsDocument( sal_True ), bIsFolder( sal_False ) {}
59 : : };
60 : :
61 : : //=========================================================================
62 : :
63 : : class Content : public ::ucbhelper::ContentImplHelper
64 : : {
65 : : public:
66 : :
67 : : Content( const ::com::sun::star::uno::Reference<
68 : : ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
69 : : ::ucbhelper::ContentProviderImplHelper* pProvider,
70 : : const ::com::sun::star::uno::Reference<
71 : : ::com::sun::star::ucb::XContentIdentifier >& Identifier,
72 : : Databases* pDatabases );
73 : :
74 : : virtual ~Content();
75 : :
76 : : // XInterface
77 : : XINTERFACE_DECL()
78 : :
79 : : // XTypeProvider
80 : : XTYPEPROVIDER_DECL()
81 : :
82 : : // XServiceInfo
83 : : virtual ::rtl::OUString SAL_CALL
84 : : getImplementationName()
85 : : throw( ::com::sun::star::uno::RuntimeException );
86 : :
87 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
88 : : getSupportedServiceNames()
89 : : throw( ::com::sun::star::uno::RuntimeException );
90 : :
91 : : // XContent
92 : : virtual rtl::OUString SAL_CALL
93 : : getContentType()
94 : : throw( com::sun::star::uno::RuntimeException );
95 : :
96 : : // XCommandProcessor
97 : : virtual com::sun::star::uno::Any SAL_CALL
98 : : execute( const com::sun::star::ucb::Command& aCommand,
99 : : sal_Int32 CommandId,
100 : : const com::sun::star::uno::Reference<
101 : : com::sun::star::ucb::XCommandEnvironment >& Environment )
102 : : throw( com::sun::star::uno::Exception,
103 : : com::sun::star::ucb::CommandAbortedException,
104 : : com::sun::star::uno::RuntimeException );
105 : :
106 : : virtual void SAL_CALL
107 : : abort( sal_Int32 CommandId )
108 : : throw( com::sun::star::uno::RuntimeException );
109 : :
110 : :
111 : : private:
112 : :
113 : : // private members;
114 : :
115 : : ContentProperties m_aProps;
116 : : URLParameter m_aURLParameter;
117 : : Databases* m_pDatabases;
118 : :
119 : :
120 : : // private methods
121 : :
122 : : virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
123 : : getProperties( const com::sun::star::uno::Reference<
124 : : com::sun::star::ucb::XCommandEnvironment > & xEnv );
125 : : virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
126 : : getCommands( const com::sun::star::uno::Reference<
127 : : com::sun::star::ucb::XCommandEnvironment > & xEnv );
128 : :
129 : 0 : virtual ::rtl::OUString getParentURL() { return ::rtl::OUString(); }
130 : :
131 : : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
132 : : getPropertyValues( const ::com::sun::star::uno::Sequence<
133 : : ::com::sun::star::beans::Property >& rProperties );
134 : : void setPropertyValues(
135 : : const ::com::sun::star::uno::Sequence<
136 : : ::com::sun::star::beans::PropertyValue >& rValues );
137 : :
138 : :
139 : : };
140 : :
141 : : }
142 : :
143 : : #endif
144 : :
145 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|