Stop leaking all ScPostIt instances.
[LibreOffice.git] / ucb / source / ucp / file / filinpstr.hxx
blob55514b68c8fb331aa52f7a41d7c75c7e730bf0d3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _FILINPSTR_HXX_
20 #define _FILINPSTR_HXX_
22 #include <rtl/ustring.hxx>
23 #include <cppuhelper/weak.hxx>
24 #include <ucbhelper/macros.hxx>
25 #include <com/sun/star/uno/XInterface.hpp>
26 #include <com/sun/star/lang/XTypeProvider.hpp>
27 #include <com/sun/star/io/XSeekable.hpp>
28 #include <com/sun/star/io/XInputStream.hpp>
29 #include <com/sun/star/ucb/XContentProvider.hpp>
31 #include "filrec.hxx"
33 namespace fileaccess {
35 // forward declaration
37 class shell;
40 class XInputStream_impl
41 : public cppu::OWeakObject,
42 public com::sun::star::lang::XTypeProvider,
43 public com::sun::star::io::XInputStream,
44 public com::sun::star::io::XSeekable
46 public:
48 XInputStream_impl( shell* pMyShell,const OUString& aUncPath, sal_Bool bLock );
50 virtual ~XInputStream_impl();
52 /**
53 * Returns an error code as given by filerror.hxx
56 sal_Int32 SAL_CALL CtorSuccess();
57 sal_Int32 SAL_CALL getMinorError();
60 // XTypeProvider
62 XTYPEPROVIDER_DECL()
64 virtual com::sun::star::uno::Any SAL_CALL
65 queryInterface(
66 const com::sun::star::uno::Type& rType )
67 throw( com::sun::star::uno::RuntimeException);
69 virtual void SAL_CALL
70 acquire(
71 void )
72 throw();
74 virtual void SAL_CALL
75 release(
76 void )
77 throw();
79 virtual sal_Int32 SAL_CALL
80 readBytes(
81 com::sun::star::uno::Sequence< sal_Int8 >& aData,
82 sal_Int32 nBytesToRead )
83 throw( com::sun::star::io::NotConnectedException,
84 com::sun::star::io::BufferSizeExceededException,
85 com::sun::star::io::IOException,
86 com::sun::star::uno::RuntimeException);
88 virtual sal_Int32 SAL_CALL
89 readSomeBytes(
90 com::sun::star::uno::Sequence< sal_Int8 >& aData,
91 sal_Int32 nMaxBytesToRead )
92 throw( com::sun::star::io::NotConnectedException,
93 com::sun::star::io::BufferSizeExceededException,
94 com::sun::star::io::IOException,
95 com::sun::star::uno::RuntimeException);
97 virtual void SAL_CALL
98 skipBytes(
99 sal_Int32 nBytesToSkip )
100 throw( com::sun::star::io::NotConnectedException,
101 com::sun::star::io::BufferSizeExceededException,
102 com::sun::star::io::IOException,
103 com::sun::star::uno::RuntimeException );
105 virtual sal_Int32 SAL_CALL
106 available(
107 void )
108 throw( com::sun::star::io::NotConnectedException,
109 com::sun::star::io::IOException,
110 com::sun::star::uno::RuntimeException );
112 virtual void SAL_CALL
113 closeInput(
114 void )
115 throw( com::sun::star::io::NotConnectedException,
116 com::sun::star::io::IOException,
117 com::sun::star::uno::RuntimeException );
119 virtual void SAL_CALL
120 seek(
121 sal_Int64 location )
122 throw( com::sun::star::lang::IllegalArgumentException,
123 com::sun::star::io::IOException,
124 com::sun::star::uno::RuntimeException );
126 virtual sal_Int64 SAL_CALL
127 getPosition(
128 void )
129 throw( com::sun::star::io::IOException,
130 com::sun::star::uno::RuntimeException );
132 virtual sal_Int64 SAL_CALL
133 getLength(
134 void )
135 throw( com::sun::star::io::IOException,
136 com::sun::star::uno::RuntimeException );
138 private:
140 com::sun::star::uno::Reference<
141 com::sun::star::ucb::XContentProvider > m_xProvider;
142 sal_Bool m_nIsOpen;
144 ReconnectingFile m_aFile;
146 sal_Int32 m_nErrorCode;
147 sal_Int32 m_nMinorErrorCode;
151 } // end namespace XInputStream_impl
153 #endif
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */