/xmlhelp/source/cxxhelp/provider/content.hxx

https://bitbucket.org/jorgenio/libreoffice · C++ Header · 154 lines · 78 code · 37 blank · 39 comment · 0 complexity · bb9e1f13adc52fe56d6bfeca6003a7b5 MD5 · raw file

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /*************************************************************************
  3. *
  4. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5. *
  6. * Copyright 2000, 2010 Oracle and/or its affiliates.
  7. *
  8. * OpenOffice.org - a multi-platform office productivity suite
  9. *
  10. * This file is part of OpenOffice.org.
  11. *
  12. * OpenOffice.org is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Lesser General Public License version 3
  14. * only, as published by the Free Software Foundation.
  15. *
  16. * OpenOffice.org is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Lesser General Public License version 3 for more details
  20. * (a copy is included in the LICENSE file that accompanied this code).
  21. *
  22. * You should have received a copy of the GNU Lesser General Public License
  23. * version 3 along with OpenOffice.org. If not, see
  24. * <http://www.openoffice.org/license.html>
  25. * for a copy of the LGPLv3 License.
  26. *
  27. ************************************************************************/
  28. #ifndef _CONTENT_HXX
  29. #define _CONTENT_HXX
  30. #include <ucbhelper/contenthelper.hxx>
  31. #include <com/sun/star/io/XInputStream.hpp>
  32. #include "urlparameter.hxx"
  33. namespace com { namespace sun { namespace star { namespace beans {
  34. struct Property;
  35. struct PropertyValue;
  36. } } } }
  37. namespace com { namespace sun { namespace star { namespace sdbc {
  38. class XRow;
  39. } } } }
  40. namespace chelp
  41. {
  42. //=========================================================================
  43. // UNO service name for the content.
  44. #define MYUCP_CONTENT_SERVICE_NAME \
  45. "com.sun.star.ucb.CHelpContent"
  46. //=========================================================================
  47. class Databases;
  48. struct ContentProperties
  49. {
  50. ::rtl::OUString aTitle; // Title
  51. ::rtl::OUString aContentType; // ContentType
  52. sal_Bool bIsDocument; // IsDocument
  53. sal_Bool bIsFolder; // IsFolder
  54. ContentProperties()
  55. : bIsDocument( sal_True ), bIsFolder( sal_False ) {}
  56. };
  57. //=========================================================================
  58. class Content : public ::ucbhelper::ContentImplHelper
  59. {
  60. public:
  61. Content( const ::com::sun::star::uno::Reference<
  62. ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
  63. ::ucbhelper::ContentProviderImplHelper* pProvider,
  64. const ::com::sun::star::uno::Reference<
  65. ::com::sun::star::ucb::XContentIdentifier >& Identifier,
  66. Databases* pDatabases );
  67. virtual ~Content();
  68. // XInterface
  69. XINTERFACE_DECL()
  70. // XTypeProvider
  71. XTYPEPROVIDER_DECL()
  72. // XServiceInfo
  73. virtual ::rtl::OUString SAL_CALL
  74. getImplementationName()
  75. throw( ::com::sun::star::uno::RuntimeException );
  76. virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
  77. getSupportedServiceNames()
  78. throw( ::com::sun::star::uno::RuntimeException );
  79. // XContent
  80. virtual rtl::OUString SAL_CALL
  81. getContentType()
  82. throw( com::sun::star::uno::RuntimeException );
  83. // XCommandProcessor
  84. virtual com::sun::star::uno::Any SAL_CALL
  85. execute( const com::sun::star::ucb::Command& aCommand,
  86. sal_Int32 CommandId,
  87. const com::sun::star::uno::Reference<
  88. com::sun::star::ucb::XCommandEnvironment >& Environment )
  89. throw( com::sun::star::uno::Exception,
  90. com::sun::star::ucb::CommandAbortedException,
  91. com::sun::star::uno::RuntimeException );
  92. virtual void SAL_CALL
  93. abort( sal_Int32 CommandId )
  94. throw( com::sun::star::uno::RuntimeException );
  95. private:
  96. // private members;
  97. ContentProperties m_aProps;
  98. URLParameter m_aURLParameter;
  99. Databases* m_pDatabases;
  100. // private methods
  101. virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
  102. getProperties( const com::sun::star::uno::Reference<
  103. com::sun::star::ucb::XCommandEnvironment > & xEnv );
  104. virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
  105. getCommands( const com::sun::star::uno::Reference<
  106. com::sun::star::ucb::XCommandEnvironment > & xEnv );
  107. virtual ::rtl::OUString getParentURL() { return ::rtl::OUString(); }
  108. ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
  109. getPropertyValues( const ::com::sun::star::uno::Sequence<
  110. ::com::sun::star::beans::Property >& rProperties );
  111. void setPropertyValues(
  112. const ::com::sun::star::uno::Sequence<
  113. ::com::sun::star::beans::PropertyValue >& rValues );
  114. };
  115. }
  116. #endif
  117. /* vim:set shiftwidth=4 softtabstop=4 expandtab: */