build fix
[LibreOffice.git] / connectivity / source / drivers / kab / kcondition.hxx
bloba6b1cd8808b60b03a1c1d740658318e5aeaf305a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_KAB_KCONDITION_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_KAB_KCONDITION_HXX
23 #include <comphelper/types.hxx>
24 #include <shell/kde_headers.h>
25 #include <connectivity/dbexception.hxx>
27 namespace connectivity
29 namespace kab
32 class KabCondition
34 public:
35 virtual ~KabCondition();
36 virtual bool isAlwaysTrue() const = 0;
37 virtual bool isAlwaysFalse() const = 0;
38 virtual bool eval(const ::KABC::Addressee &aAddressee) const = 0;
41 class KabConditionConstant : public KabCondition
43 protected:
44 bool m_bValue;
46 public:
47 explicit KabConditionConstant(const bool bValue);
48 virtual bool isAlwaysTrue() const override;
49 virtual bool isAlwaysFalse() const override;
50 virtual bool eval(const ::KABC::Addressee &aAddressee) const override;
53 class KabConditionColumn : public KabCondition
55 protected:
56 sal_Int32 m_nFieldNumber;
58 QString value(const ::KABC::Addressee &aAddressee) const;
60 public:
61 explicit KabConditionColumn(
62 const OUString &sColumnName) throw(css::sdbc::SQLException);
63 virtual bool isAlwaysTrue() const override;
64 virtual bool isAlwaysFalse() const override;
67 class KabConditionNull : public KabConditionColumn
69 public:
70 explicit KabConditionNull(
71 const OUString &sColumnName) throw(css::sdbc::SQLException);
72 virtual bool eval(const ::KABC::Addressee &aAddressee) const override;
75 class KabConditionNotNull : public KabConditionColumn
77 public:
78 explicit KabConditionNotNull(
79 const OUString &sColumnName) throw(css::sdbc::SQLException);
80 virtual bool eval(const ::KABC::Addressee &aAddressee) const override;
83 class KabConditionCompare : public KabConditionColumn
85 protected:
86 const OUString m_sMatchString;
88 public:
89 KabConditionCompare(
90 const OUString &sColumnName,
91 const OUString &sMatchString) throw(css::sdbc::SQLException);
94 class KabConditionEqual : public KabConditionCompare
96 public:
97 KabConditionEqual(
98 const OUString &sColumnName,
99 const OUString &sMatchString) throw(css::sdbc::SQLException);
100 virtual bool eval(const ::KABC::Addressee &aAddressee) const override;
103 class KabConditionDifferent : public KabConditionCompare
105 public:
106 KabConditionDifferent(
107 const OUString &sColumnName,
108 const OUString &sMatchString) throw(css::sdbc::SQLException);
109 virtual bool eval(const ::KABC::Addressee &aAddressee) const override;
112 class KabConditionSimilar : public KabConditionCompare
114 public:
115 KabConditionSimilar(
116 const OUString &sColumnName,
117 const OUString &sMatchString) throw(css::sdbc::SQLException);
118 virtual bool eval(const ::KABC::Addressee &aAddressee) const override;
121 class KabConditionBoolean : public KabCondition
123 protected:
124 KabCondition *m_pLeft, *m_pRight;
126 public:
127 KabConditionBoolean(KabCondition *pLeft, KabCondition *pRight);
128 virtual ~KabConditionBoolean() override;
131 class KabConditionOr : public KabConditionBoolean
133 public:
134 KabConditionOr(KabCondition *pLeft, KabCondition *pRight);
135 virtual bool isAlwaysTrue() const override;
136 virtual bool isAlwaysFalse() const override;
137 virtual bool eval(const ::KABC::Addressee &aAddressee) const override;
140 class KabConditionAnd : public KabConditionBoolean
142 public:
143 KabConditionAnd(KabCondition *pLeft, KabCondition *pRight);
144 virtual bool isAlwaysTrue() const override;
145 virtual bool isAlwaysFalse() const override;
146 virtual bool eval(const ::KABC::Addressee &addressee) const override;
152 #endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_KAB_KCONDITION_HXX
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */