--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_CALL_H__
+#define __CALLUI_MODEL_CALL_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class Call final : public ucl::NonCopyable {
+ public:
+ static CallSRef newInstance();
+ virtual ~Call();
+
+ ISoundManagerSRef getSoundManager();
+ ICallManagerSRef getCallManager();
+
+ private:
+ friend class ucl::RefCountObj<Call>;
+ Call();
+
+ ucl::Result prepare();
+
+ };
+
+}
+
+#endif // __CALLUI_MODEL_CALL_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_ACTIVE_CALL_H__
+#define __CALLUI_MODEL_I_ACTIVE_CALL_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IActiveCall : public ucl::Polymorphic {
+ public:
+ virtual ICallInfoSCRef getInfo() const = 0;
+ virtual bool isDialingMode() const = 0;
+ virtual ucl::Result hold() = 0;
+ virtual ucl::Result end() = 0;
+ virtual ucl::Result split(const IConferenceCallInfoSRef &confCallInfo) = 0;
+ };
+
+}
+
+#endif // __CALLUI_MODEL_I_ACTIVE_CALL_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_CALL_DIALER_H__
+#define __CALLUI_MODEL_I_CALL_DIALER_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class ICallDialer: public ucl::Polymorphic {
+ public:
+ using DialStatusHandler = ucl::Delegate<void(DialStatus)>;
+
+ public:
+ virtual ucl::Result dialVoiceCall(const std::string &number, SimSlot simSlot) = 0;
+ virtual ucl::Result addDialStatusHandler(DialStatusHandler handler) = 0;
+ virtual ucl::Result removeDialStatusHandler(DialStatusHandler handler) = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_CALL_DIALER_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_CALL_INFO_H__
+#define __CALLUI_MODEL_I_CALL_INFO_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class ICallInfo : public ucl::Polymorphic {
+ public:
+ virtual const std::string &getPhoneNumber() const = 0;
+ virtual IContactInfoSCRef getContactInfo() const = 0;
+ virtual long getStartTime() const = 0;
+ virtual bool isEmergency() const = 0;
+ virtual bool isDialing() const = 0;
+ virtual int getConferenceMemberCount() const = 0;
+ virtual const ConfMemberCallList &getConferenceMemberList() const = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_CALL_INFO_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_STATE_PROVIDER_H__
+#define __CALLUI_MODEL_I_STATE_PROVIDER_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class ICallManager : public ucl::Polymorphic {
+ public:
+ virtual ICallDialerWRef getDialer() = 0;
+ virtual IIncomingCallWRef getIncomingCall() = 0;
+ virtual IActiveCallWRef getActiveCall() = 0;
+ virtual IHeldCallWRef getHeldCall() = 0;
+ virtual IEndCallWRef getEndCall() = 0;
+ virtual CallMask getAvailableCallMask() const = 0;
+ virtual void addCallStateHandler(const CallStateHandler handler) = 0;
+ virtual void removeCallStateHandler(const CallStateHandler handler) = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_STATE_PROVIDER_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_CONFERENCE_CALL_INFO_H__
+#define __CALLUI_MODEL_I_CONFERENCE_CALL_INFO_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IConferenceCallInfo : public ucl::Polymorphic {
+ public:
+ virtual const std::string &getPhoneNumber() const = 0;
+ virtual IContactInfoSRef getContactInfo() const = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_CONFERENCE_CALL_INFO_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_CONTACT_INFO_H__
+#define __CALLUI_MODEL_I_CONTACT_INFO_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IContactInfo : public ucl::Polymorphic {
+ public:
+ virtual const std::string &getName() const = 0;
+ virtual const std::string &getImagePath() const = 0;
+ virtual ContactNameSourceType getNameSourceType() const = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_CONTACT_INFO_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_END_CALL_H__
+#define __CALLUI_MODEL_I_END_CALL_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IEndCall : public ucl::Polymorphic {
+ public:
+ virtual ICallInfoSCRef getInfo() const = 0;
+ virtual ucl::Result callBack() = 0;
+ virtual ucl::Result writeMessage() = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_END_CALL_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_HELD_CALL_H__
+#define __CALLUI_MODEL_I_HELD_CALL_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IHeldCall : public ucl::Polymorphic {
+ public:
+ virtual ICallInfoSCRef getInfo() const = 0;
+ virtual ucl::Result unhold() = 0;
+ virtual ucl::Result joinWithActive() = 0;
+ virtual ucl::Result swapWithActive() = 0;
+ virtual ucl::Result end() = 0;
+ virtual ucl::Result split(const IConferenceCallInfoSRef &confCallInfo) = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_HELD_CALL_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_INCOMING_CALL_H__
+#define __CALLUI_MODEL_I_INCOMING_CALL_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IIncomingCall : public ucl::Polymorphic {
+ public:
+ virtual ICallInfoSCRef getInfo() const = 0;
+ virtual ucl::Result answer(CallAnswerType type) = 0;
+ virtual ucl::Result reject() = 0;
+ virtual ucl::Result rejectWithMessage(const std::string &message) = 0;
+ virtual ucl::Result stopAlert() = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_INCOMING_CALL_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_I_SOUND_MANAGER_H__
+#define __CALLUI_MODEL_I_SOUND_MANAGER_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class ISoundManager: public ucl::Polymorphic {
+ public:
+ using AudioStateHandler = ucl::Delegate<void(AudioStateType)>;
+ using MuteStateHandler = ucl::Delegate<void(bool)>;
+
+ public:
+ virtual ucl::Result setSpeakerState(bool isEnable) = 0;
+ virtual ucl::Result setBluetoothState(bool isEnable) = 0;
+ virtual AudioStateType getAudioState() = 0;
+ virtual ucl::Result setMuteState(bool isEnable) = 0;
+ virtual bool getMuteState() const = 0;
+ virtual ucl::Result startDtmf(const unsigned char dtmfDigit) = 0;
+ virtual ucl::Result stopDtmf() = 0;
+ virtual ucl::Result addAudioStateChangeHandler(AudioStateHandler handler) = 0;
+ virtual ucl::Result removeAudioStateChangeHandler(AudioStateHandler handler) = 0;
+ virtual ucl::Result addMuteStateChangeHandler(MuteStateHandler handler) = 0;
+ virtual ucl::Result removeMuteStateChangeHandler(MuteStateHandler handler) = 0;
+ };
+}
+
+#endif // __CALLUI_MODEL_I_SOUND_MANAGER_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_TYPES_H__
+#define __CALLUI_MODEL_TYPES_H__
+
+#include "../types.h"
+#include <list>
+
+namespace callui {
+
+ enum class SimSlot {
+ FIRST,
+ SECOND,
+ DEFAULT
+ };
+
+ enum class CallReleaseType {
+ BY_CALL_HANDLE,
+ ALL,
+ ALL_HOLD,
+ ALL_ACTIVE
+ };
+
+ enum class CallAnswerType {
+ NORMAL,
+ HOLD_ACTIVE_AND_ACCEPT,
+ RELEASE_ACTIVE_AND_ACCEPT,
+ RELEASE_HOLD_AND_ACCEPT,
+ RELEASE_ALL_AND_ACCEPT
+ };
+
+ enum class DialStatus {
+ SUCCESS,
+ CANCEL,
+ FAIL,
+ FAIL_SS,
+ FDN,
+ FLIGHT_MODE
+ };
+
+ enum class AudioStateType {
+ NONE,
+ SPEAKER,
+ RECEIVER,
+ EARJACK,
+ BT
+ };
+
+ enum {
+ CALL_FLAG_INCOMING = 1,
+ CALL_FLAG_ACTIVE = 2,
+ CALL_FLAG_HELD = 4,
+ CALL_FLAG_END = 8
+ };
+ using CallMask = int;
+
+ enum class CallEventType {
+ END,
+ DIALING,
+ ACTIVE,
+ HELD,
+ ALERT,
+ INCOMING,
+ WAITING,
+ JOIN,
+ SPLIT,
+ SWAPPED,
+ RETRIEVED,
+ SAT_CALL_CONTROL
+ };
+
+ enum class ContactNameSourceType {
+ INVALID,
+ EMAIL,
+ NUMBER,
+ NICKNAME,
+ COMPANY,
+ NAME
+ };
+
+ UCL_DECLARE_REF_ALIASES(Call);
+
+ UCL_DECLARE_REF_ALIASES(ICallManager);
+ UCL_DECLARE_REF_ALIASES(ISoundManager);
+ UCL_DECLARE_REF_ALIASES(ICallDialer);
+
+ UCL_DECLARE_REF_ALIASES(IIncomingCall);
+ UCL_DECLARE_REF_ALIASES(IActiveCall);
+ UCL_DECLARE_REF_ALIASES(IHeldCall);
+ UCL_DECLARE_REF_ALIASES(IEndCall);
+
+ UCL_DECLARE_REF_ALIASES(ICallInfo);
+ UCL_DECLARE_REF_ALIASES(IContactInfo);
+ UCL_DECLARE_REF_ALIASES(IConferenceCallInfo);
+
+ using CallStateHandler = ucl::Delegate<void(CallEventType)>;
+
+ using ConfMemberCallList = std::list<IConferenceCallInfoSCRef>;
+}
+
+#endif // __GALLERY_MODEL_TYPES_H__
#include "ucl/util/memory.h"
#include "ucl/util/delegation.h"
-#endif // __CALLUI_TYPES_H_
+#endif // __CALLUI_TYPES_H__
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "model/Call.h"
+
+#include "common.h"
+
+namespace callui {
+
+ using namespace ucl;
+
+ Call::Call()
+ {
+ }
+
+ Call::~Call()
+ {
+ }
+
+ CallSRef Call::newInstance()
+ {
+ auto result = makeShared<Call>();
+ FAIL_RETURN_VALUE(result->prepare(), {}, "result->prepare() failed!");
+ return result;
+ }
+
+ ucl::Result Call::prepare()
+ {
+ return RES_OK;
+ }
+
+ ICallManagerSRef Call::getCallManager()
+ {
+ UCL_ASSERT(0, "!!! NOT IMPLEMENTED !!!");
+ }
+
+ ISoundManagerSRef Call::getSoundManager()
+ {
+ UCL_ASSERT(0, "!!! NOT IMPLEMENTED !!!");
+ }
+
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_MODEL_COMMON_H__
+#define __CALLUI_MODEL_COMMON_H__
+
+#include "../common.h"
+
+#endif // __CALLUI_MODEL_COMMON_H__