1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sal/config.h>
26 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
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))
38 namespace ucb::ucp::gio::glib
{
42 struct MainContextUnref
{
43 void operator ()(GMainContext
* context
) {
44 if (context
!= nullptr) {
45 g_main_context_unref(context
);
52 using MainContextRef
= std::unique_ptr
<GMainContext
, detail::MainContextUnref
>;
56 struct OOoMountOperation
58 GMountOperation parent_instance
;
60 ucb::ucp::gio::glib::MainContextRef context
;
61 const css::uno::Reference
< css::ucb::XCommandEnvironment
> *pEnv
;
62 char *m_pPrevUsername
;
63 char *m_pPrevPassword
;
66 // Managed via ooo_mount_operation_new and ooo_mount_operation_finalize:
67 OOoMountOperation() = delete;
68 ~OOoMountOperation() = delete;
71 struct OOoMountOperationClass
73 GMountOperationClass parent_class
;
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);
83 GType
ooo_mount_operation_get_type();
84 GMountOperation
*ooo_mount_operation_new(ucb::ucp::gio::glib::MainContextRef
&& context
, const css::uno::Reference
< css::ucb::XCommandEnvironment
>& rEnv
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */