2012-02-17 14:11:18 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MIRALLCONFIGFILE_H
|
|
|
|
#define MIRALLCONFIGFILE_H
|
|
|
|
|
2012-05-21 18:48:49 +04:00
|
|
|
#include <QString>
|
|
|
|
|
2012-07-25 18:51:29 +04:00
|
|
|
class QVariant;
|
2012-05-21 18:48:49 +04:00
|
|
|
|
2012-02-17 14:11:18 +04:00
|
|
|
namespace Mirall {
|
|
|
|
|
|
|
|
|
|
|
|
class MirallConfigFile
|
|
|
|
{
|
|
|
|
public:
|
2012-06-12 14:27:02 +04:00
|
|
|
MirallConfigFile( const QString& appendix = QString() );
|
2012-02-17 14:11:18 +04:00
|
|
|
|
2012-07-25 18:51:29 +04:00
|
|
|
enum customMediaType {
|
2012-07-26 12:01:43 +04:00
|
|
|
oCSetupTop, // ownCloud connect page
|
2012-07-25 18:51:29 +04:00
|
|
|
oCSetupSide,
|
|
|
|
oCSetupBottom,
|
2012-07-26 12:01:43 +04:00
|
|
|
oCSetupFixUrl,
|
|
|
|
oCSetupResultTop // ownCloud connect result page
|
2012-07-25 18:51:29 +04:00
|
|
|
};
|
|
|
|
|
2012-03-28 13:26:51 +04:00
|
|
|
QString configPath() const;
|
2012-03-28 14:23:34 +04:00
|
|
|
QString configFile() const;
|
|
|
|
QString excludeFile() const;
|
|
|
|
|
2012-02-17 14:11:18 +04:00
|
|
|
bool exists();
|
2012-02-18 20:02:10 +04:00
|
|
|
|
2012-02-17 18:54:39 +04:00
|
|
|
bool connectionExists( const QString& = QString() );
|
2012-02-18 20:02:10 +04:00
|
|
|
QString defaultConnection() const;
|
2012-02-17 14:11:18 +04:00
|
|
|
|
|
|
|
void writeOwncloudConfig( const QString& connection,
|
|
|
|
const QString& url,
|
|
|
|
const QString& user,
|
2012-08-01 19:20:16 +04:00
|
|
|
const QString& passwd,
|
|
|
|
bool https, bool skipPwd );
|
2012-02-18 20:02:10 +04:00
|
|
|
|
2012-02-17 18:54:39 +04:00
|
|
|
void removeConnection( const QString& connection = QString() );
|
2012-02-17 14:11:18 +04:00
|
|
|
|
2012-02-18 20:02:10 +04:00
|
|
|
QString ownCloudUrl( const QString& connection = QString(), bool webdav = false ) const;
|
2012-02-17 14:11:18 +04:00
|
|
|
|
2012-08-06 15:57:26 +04:00
|
|
|
void setOwnCloudUrl(const QString &connection, const QString& );
|
|
|
|
|
|
|
|
// the certs do not depend on a connection.
|
|
|
|
QByteArray caCerts();
|
|
|
|
void setCaCerts( const QByteArray& );
|
|
|
|
|
2012-02-17 14:11:18 +04:00
|
|
|
QString ownCloudUser( const QString& connection = QString() ) const;
|
|
|
|
|
|
|
|
QString ownCloudPasswd( const QString& connection = QString() ) const;
|
2012-02-18 20:02:10 +04:00
|
|
|
|
2012-05-14 18:22:30 +04:00
|
|
|
QString ownCloudVersion() const;
|
|
|
|
void setOwnCloudVersion( const QString& );
|
|
|
|
|
2012-07-25 18:51:29 +04:00
|
|
|
QVariant customMedia( customMediaType );
|
|
|
|
|
2012-06-05 17:11:29 +04:00
|
|
|
// max count of lines in the log window
|
|
|
|
int maxLogLines() const;
|
|
|
|
|
2012-04-02 22:10:29 +04:00
|
|
|
bool ownCloudSkipUpdateCheck( const QString& connection = QString() ) const;
|
|
|
|
|
2012-05-26 16:37:21 +04:00
|
|
|
/* Poll intervals in milliseconds */
|
|
|
|
int localPollInterval ( const QString& connection = QString() ) const;
|
|
|
|
int remotePollInterval( const QString& connection = QString() ) const;
|
|
|
|
int pollTimerExceedFactor( const QString& connection = QString() ) const;
|
|
|
|
|
2012-02-18 20:02:10 +04:00
|
|
|
QByteArray basicAuthHeader() const;
|
2012-04-12 16:06:59 +04:00
|
|
|
|
2012-06-12 14:27:02 +04:00
|
|
|
// Custom Config: accept the custom config to become the main one.
|
|
|
|
void acceptCustomConfig();
|
|
|
|
// Custom Config: remove the custom config file.
|
|
|
|
void cleanupCustomConfig();
|
|
|
|
|
2012-07-31 12:17:52 +04:00
|
|
|
// proxy settings
|
|
|
|
void setProxyType(int proxyType,
|
|
|
|
const QString& host = QString(),
|
|
|
|
int port = 0,
|
|
|
|
const QString& user = QString(),
|
|
|
|
const QString& pass = QString());
|
|
|
|
|
|
|
|
int proxyType() const;
|
|
|
|
QString proxyHostName() const;
|
|
|
|
int proxyPort() const;
|
|
|
|
QString proxyUser() const;
|
|
|
|
QString proxyPassword() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QVariant getValue(const QString& param, const QString& group) const;
|
|
|
|
|
|
|
|
|
2012-04-12 16:06:59 +04:00
|
|
|
private:
|
|
|
|
static QString _passwd;
|
|
|
|
static bool _askedUser;
|
2012-05-14 18:22:30 +04:00
|
|
|
static QString _oCVersion;
|
2012-06-12 14:27:02 +04:00
|
|
|
QString _customHandle;
|
2012-02-17 14:11:18 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif // MIRALLCONFIGFILE_H
|