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