LibreOffice Module ucb (master)  1
gio_mount.hxx
Go to the documentation of this file.
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 INCLUDED_UCB_SOURCE_UCP_GIO_GIO_MOUNT_HXX
21 #define INCLUDED_UCB_SOURCE_UCP_GIO_GIO_MOUNT_HXX
22 
23 #include <sal/config.h>
24 
25 #include <memory>
26 
27 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
28 #include <gio/gio.h>
29 
30 G_BEGIN_DECLS
31 
32 #define OOO_TYPE_MOUNT_OPERATION (ooo_mount_operation_get_type ())
33 #define OOO_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), OOO_TYPE_MOUNT_OPERATION, OOoMountOperation))
34 #define OOO_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), OOO_TYPE_MOUNT_OPERATION, OOoMountOperationClass))
35 #define OOO_IS_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), OOO_TYPE_MOUNT_OPERATION))
36 #define OOO_IS_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), OOO_TYPE_MOUNT_OPERATION))
37 #define OOO_MOUNT_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), OOO_TYPE_MOUNT_OPERATION, OOoMountOperationClass))
38 
40 
41 namespace detail {
42 
44  void operator ()(GMainContext * context) {
45  if (context != nullptr) {
46  g_main_context_unref(context);
47  }
48  }
49 };
50 
51 }
52 
53 using MainContextRef = std::unique_ptr<GMainContext, detail::MainContextUnref>;
54 
55 }
56 
58 {
59  GMountOperation parent_instance;
60 
62  const css::uno::Reference< css::ucb::XCommandEnvironment > *pEnv;
65 
66 private:
67  // Managed via ooo_mount_operation_new and ooo_mount_operation_finalize:
68  OOoMountOperation() = delete;
69  ~OOoMountOperation() = delete;
70 };
71 
73 {
74  GMountOperationClass parent_class;
75 
76  /* Padding for future expansion */
81 };
82 
83 
85 GMountOperation *ooo_mount_operation_new(ucb::ucp::gio::glib::MainContextRef && context, const css::uno::Reference< css::ucb::XCommandEnvironment >& rEnv);
86 
87 G_END_DECLS
88 #endif
89 
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void(* _gtk_reserved1)(void)
Definition: gio_mount.hxx:77
void(* _gtk_reserved3)(void)
Definition: gio_mount.hxx:79
void(* _gtk_reserved4)(void)
Definition: gio_mount.hxx:80
std::unique_ptr< GMainContext, detail::MainContextUnref > MainContextRef
Definition: gio_mount.hxx:53
GType ooo_mount_operation_get_type()
void operator()(GMainContext *context)
Definition: gio_mount.hxx:44
char * m_pPrevUsername
Definition: gio_mount.hxx:63
const css::uno::Reference< css::ucb::XCommandEnvironment > * pEnv
Definition: gio_mount.hxx:62
GMountOperationClass parent_class
Definition: gio_mount.hxx:74
ucb::ucp::gio::glib::MainContextRef context
Definition: gio_mount.hxx:61
GMountOperation * ooo_mount_operation_new(ucb::ucp::gio::glib::MainContextRef &&context, const css::uno::Reference< css::ucb::XCommandEnvironment > &rEnv)
Definition: gio_mount.cxx:202
GMountOperation parent_instance
Definition: gio_mount.hxx:59
OOoMountOperation()=delete
void(* _gtk_reserved2)(void)
Definition: gio_mount.hxx:78
~OOoMountOperation()=delete
char * m_pPrevPassword
Definition: gio_mount.hxx:64
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo