Debian Codegraph @

ucb/source/ucp/gio/gio_mount.hxx

raw
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
29 G_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
38 namespace ucb::ucp::gio::glib {
39
40 namespace detail {
41
42 struct MainContextUnref {
43 void operator ()(GMainContext * context) {
44 if (context != nullptr) {
45 g_main_context_unref(context);
46 }
47 }
48 };
49
50 }
51
52 using MainContextRef = std::unique_ptr<GMainContext, detail::MainContextUnref>;
53
54 }
55
56 struct OOoMountOperation
57 {
58 friend GMountOperation *ooo_mount_operation_new(ucb::ucp::gio::glib::MainContextRef &&, const css::uno::Reference< css::ucb::XCommandEnvironment >&);
59 friend void ooo_mount_operation_finalize(GObject *);
60
61 GMountOperation parent_instance;
62
63 ucb::ucp::gio::glib::MainContextRef context;
64 css::uno::Reference< css::ucb::XCommandEnvironment > xEnv;
65 OUString m_aPrevUsername;
66 OUString m_aPrevPassword;
67
68 private:
69 // Managed via ooo_mount_operation_new and ooo_mount_operation_finalize:
70 OOoMountOperation() = default;
71 ~OOoMountOperation() = default;
72 };
73
74 struct OOoMountOperationClass
75 {
76 GMountOperationClass parent_class;
77
78 /* Padding for future expansion */
79 void (*_gtk_reserved1) (void);
80 void (*_gtk_reserved2) (void);
81 void (*_gtk_reserved3) (void);
82 void (*_gtk_reserved4) (void);
83 };
84
85
86 GType ooo_mount_operation_get_type();
87 GMountOperation *ooo_mount_operation_new(ucb::ucp::gio::glib::MainContextRef && context, const css::uno::Reference< css::ucb::XCommandEnvironment >& rEnv);
88
89 G_END_DECLS
90
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */