Logo Search packages:      
Sourcecode: qapt version File versions  Download package

globals.h

/***************************************************************************
 *   Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>             *
 *                                                                         *
 *   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) version 3 or any later version        *
 *   accepted by the membership of KDE e.V. (or its successor approved     *
 *   by the membership of KDE e.V.), which shall act as a proxy            *
 *   defined in Section 14 of version 3 of the license.                    *
 *                                                                         *
 *   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.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 ***************************************************************************/

#ifndef QAPT_GLOBALS_H
#define QAPT_GLOBALS_H

#include <QtCore/QFlags>
#include <QtCore/QList>

namespace QApt
{
00029     class Package;
   /**
    * Defines the PackageList type, which is a QList of Packages
    */
    typedef QList<Package*> PackageList;

   /**
    * Defines the GroupList type, which is really just a QString
    */
00038     typedef QString Group;

   /**
    * Defines the CacheState type, which is used for keeping track of package
    * statuses.
    */
00044     typedef QList<int> CacheState;

   /**
    * Defines the GroupList type, which is a QList of Groups (QStrings)
    */
00049     typedef QStringList GroupList;

   /**
    * An enumerator listing all the events that the QApt Worker can emit
    */
00054     enum WorkerEvent {
        /// An invalid event
00056         InvalidEvent            = 0,
        /// The worker has begun to check for updates
00058         CacheUpdateStarted      = 1,
        /// The worker has finished checking for updates
00060         CacheUpdateFinished     = 2,
        /// The worker has started downloading packages for an install
00062         PackageDownloadStarted  = 3,
        /// The worker has finished downloading packages
00064         PackageDownloadFinished = 4,
        /// The worker has begun committing changes to the package cache
00066         CommitChangesStarted    = 5,
        /// The worker has finished committing changes
00068         CommitChangesFinished   = 6,
        /// The worker has begun to update the xapian index
00070         XapianUpdateStarted     = 7,
        /// The worker has finished updating the xapian index
00072         XapianUpdateFinished    = 8
    };

   /**
    * An enumerator listing all the question types that the QApt Worker can ask
    */
00078     enum WorkerQuestion {
        /// An invalid question
00080         InvalidQuestion  = 0,
        /// Emitted when a configuration file has been changed in an update
00082         ConfFilePrompt   = 1,
        /// Emitted to request a CD-ROM change or the like
00084         MediaChange      = 2,
        /// Emitted to check whether or not to install untrusted packages
00086         InstallUntrusted = 3
    };

   /**
    * An enumerator listing all error types that the QApt Worker can throw
    */
00092     enum ErrorCode {
        /// An invalid/unknown value
00094         UnknownError            = 0,
        /// Emitted when the APT cache could not be initialized
00096         InitError               = 1,
        /// Emitted when the package cache could not be locked
00098         LockError               = 2,
        /// Emitted when there is not enough disk space for an install
00100         DiskSpaceError          = 3,
        /// Emitted when fetching packages failed
00102         FetchError              = 4,
        /// Emitted when dpkg encounters an error during commit
00104         CommitError             = 5,
        /// Emitted when the user has not given proper authentication
00106         AuthError               = 6,
        /// Emitted when the worker crashes or disappears
00108         WorkerDisappeared       = 7,
        /// Emitted when APT prevents the installation of untrusted packages
00110         UntrustedError          = 8,
        /// A pseudo-error emitted when the user cancels a download
00112         UserCancelError         = 9,
        /// Emitted when the APT configuration prevents downloads
00114         DownloadDisallowedError = 10
    };

   /**
    * An enumerator listing all warning types that the QApt Worker can throw
    */
00120     enum WarningCode {
        /// An invalid/unknown warning
00122         UnknownWarning        = 0,
        /// Emitted when the downloaded size didn't match the expected size
00124         SizeMismatchWarning   = 1,
        /// Emitted for non-fatal fetch errors
00126         FetchFailedWarning    = 2
    };

   /**
    * An enumerator listing reason categories for why package and/or
    * its dependencies cannot be installed
    */
00133     enum BrokenReason {
        /// An unknown/invalid reason
00135         UnknownReason         = 0,
        /// Broken because the parent is not installable
00137         ParentNotInstallable  = 1,
        /// Broken because the candidate version is wrong
00139         WrongCandidateVersion = 2,
        /// Broken because a dependency won't be installed
00141         DepNotInstallable     = 3,
        /// Broken because  the package is a virtual package
00143         VirtualPackage        = 4
    };

   /**
    * An enumerator listing all types of fetches the QApt Worker can do
    */
00149     enum FetchType {
        /// An invalid enum value
00151         InvalidFetch = 0,
        /// A normal download fetch
00153         DownloadFetch = 1,
        /// A fetch that happens when the cached item equals the item on the sever
00155         HitFetch = 2,
        /// A fetch that happens when an item is ignored
00157         IgnoredFetch = 3
    };

    // Not yet used
    enum UpdateImportance {
        UnknownImportance = 1,//
        NormalImportance = 2,//
        CriticalImportance = 3,//
        SecurityImportance = 4//
    };

   /**
    * An enumerator listing screenshot types
    */
00171     enum ScreenshotType {
        /// An unknown/invalid type
00173         UnknownType = 0,
        /// A smaller thumbnail of the screenshot
00175         Thumbnail   = 1,
        /// The full screenshot
00177         Screenshot  = 2
    };
}

#endif

Generated by  Doxygen 1.6.0   Back to index