dial-plan.h 2.1 KB
Newer Older
1 2
/*
 * dial-plan.h
3
 * Copyright (C) 2010-2018 Belledonne Communications SARL
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

20 21
#ifndef _L_DIAL_PLAN_H_
#define _L_DIAL_PLAN_H_
22 23

#include <list>
24

25 26 27 28 29 30 31 32 33 34
#include "object/clonable-object.h"

// =============================================================================

LINPHONE_BEGIN_NAMESPACE

class DialPlanPrivate;

class LINPHONE_PUBLIC DialPlan : public ClonableObject {
public:
35 36 37 38 39 40 41
	DialPlan (
		const std::string &country = "",
		const std::string &isoCountryCode = "",
		const std::string &ccc = "",
		int nnl = 0,
		const std::string &icp = ""
	);
42
	DialPlan (const DialPlan &other);
43

44 45 46 47
	DialPlan* clone () const override {
		return new DialPlan(*this);
	}

48
	DialPlan &operator= (const DialPlan &other);
49

50 51 52
	const std::string &getCountry () const;
	const std::string &getIsoCountryCode () const;
	const std::string &getCountryCallingCode () const;
53
	void setCountryCallingCode(const std::string &ccc);
54 55 56
	int getNationalNumberLength () const;
	const std::string &getInternationalCallPrefix () const;
	bool isGeneric () const;
57 58 59

	static const DialPlan MostCommon;

60 61
	static int lookupCccFromE164 (const std::string &e164);
	static int lookupCccFromIso (const std::string &iso);
62
	static const DialPlan &findByCcc (int ccc);
63 64
	static const DialPlan &findByCcc (const std::string &ccc);
	static const std::list<DialPlan> &getAllDialPlans ();
65 66 67 68 69 70 71

private:
	L_DECLARE_PRIVATE(DialPlan);
};

LINPHONE_END_NAMESPACE

72
#endif // ifndef _L_DIAL_PLAN_H_