2
This file is part of the Okteta Kasten module, made within the KDE community.
4
Copyright 2012 Friedrich W. H. Kossebau <kossebau@kde.org>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) version 3, or any
10
later version accepted by the membership of KDE e.V. (or its
11
successor approved by the membership of KDE e.V.), which shall
12
act as a proxy defined in Section 6 of version 3 of the license.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library. If not, see <http://www.gnu.org/licenses/>.
23
#ifndef BYTEARRAYVIEWPROFILESYNCHRONIZER_H
24
#define BYTEARRAYVIEWPROFILESYNCHRONIZER_H
27
#include "oktetakastengui_export.h"
28
#include <bytearrayviewprofile.h>
30
#include <kastencore.h>
32
#include <QtCore/QObject>
38
class ByteArrayViewProfileManager;
41
class OKTETAKASTENGUI_EXPORT ByteArrayViewProfileSynchronizer : public QObject
47
ShowsNonprintingChanged = 1 << 0,
48
ValueCodingChanged = 1 << 1,
49
CharCodecChanged = 1 << 2,
50
SubstituteCharChanged = 1 << 3,
51
UndefinedCharChanged = 1 << 4,
52
VisibleByteArrayCodingsChanged = 1 << 5,
53
OffsetColumnVisibleChanged = 1 << 6,
54
NoOfBytesPerLineChanged = 1 << 7,
55
NoOfGroupedBytesChanged = 1 << 8,
56
LayoutStyleChanged = 1 << 9,
57
ViewModusChanged = 1 << 10
61
explicit ByteArrayViewProfileSynchronizer( ByteArrayViewProfileManager* viewProfileManager );
64
// AbstractLoadJob *startLoad( const KUrl &url );
66
void syncFromRemote();
67
// AbstractConnectJob *startConnect( AbstractDocument* document,
68
// const KUrl& url, AbstractModelSynchronizer::ConnectOption option );
70
ByteArrayView* view() const;
71
ByteArrayViewProfile::Id viewProfileId() const;
73
void setView( ByteArrayView* view );
74
void setViewProfileId( const ByteArrayViewProfile::Id& viewProfileId );
76
LocalSyncState localSyncState() const;
79
void localSyncStateChanged( Kasten2::LocalSyncState newState );
80
void viewProfileChanged( const Kasten2::ByteArrayViewProfile::Id& viewProfileId );
83
void onViewProfilesChanged( const QList<Kasten2::ByteArrayViewProfile>& viewProfiles );
84
void onViewProfilesRemoved( const QList<Kasten2::ByteArrayViewProfile::Id>& viewProfileIds );
86
// TODO: turn to one signal/slot with enum parameter for property and QVariant as new value
87
void onShowsNonprintingChanged();
88
void onValueCodingChanged();
89
void onCharCodecChanged();
90
void onSubstituteCharChanged();
91
void onUndefinedCharChanged();
92
void onVisibleByteArrayCodingsChanged();
93
void onOffsetColumnVisibleChanged();
94
void onNoOfBytesPerLineChanged();
95
void onNoOfGroupedBytesChanged();
96
void onLayoutStyleChanged();
97
void onViewModusChanged();
100
void updateView( const ByteArrayViewProfile& viewProfile );
101
void updateViewProfile( ByteArrayViewProfile& viewProfile );
102
void setDirtyFlag( int dirtyFlag );
105
ByteArrayView* mView;
106
ByteArrayViewProfile::Id mViewProfileId;
110
ByteArrayViewProfileManager* mViewProfileManager;
114
inline ByteArrayView* ByteArrayViewProfileSynchronizer::view() const { return mView; }
115
inline ByteArrayViewProfile::Id ByteArrayViewProfileSynchronizer::viewProfileId() const { return mViewProfileId; }