File indexing completed on 2024-05-19 12:06:04
0001 /* SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org> 0002 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef BREADCRUMB_H 0007 #define BREADCRUMB_H 0008 #include <QString> 0009 0010 namespace Browser 0011 { 0012 0013 /** 0014 * \brief Information about a single breadcrumb 0015 * 0016 * See \ref Browser for a detailed description of how this fits in with the rest of the classes in this module 0017 * 0018 * This is basically a simple class to make the code for handling 0019 * breadcrumbs simpler. It encodes the following information about a 0020 * breadcrumb: 0021 * \li Is this a first breadcrumb (the result of going home e.g.) 0022 * \li which text should be shown for this breadcrumb. 0023 * 0024 */ 0025 class Breadcrumb 0026 { 0027 public: 0028 static Breadcrumb empty(); 0029 static Breadcrumb home(); 0030 static Breadcrumb view(); 0031 0032 explicit Breadcrumb(const QString &text, bool isBeginning = false); 0033 QString text() const; 0034 bool isBeginning() const; 0035 bool isView() const; 0036 bool operator==(const Breadcrumb &other) const; 0037 bool operator!=(const Breadcrumb &other) const; 0038 0039 private: 0040 int m_index; 0041 bool m_isBeginning; 0042 bool m_isView; 0043 QString m_text; 0044 static int s_count; 0045 }; 0046 0047 } 0048 0049 #endif /* BREADCRUMB_H */ 0050 0051 // vi:expandtab:tabstop=4 shiftwidth=4: